diff
stringlengths 65
26.7k
| message
stringlengths 7
9.92k
|
|---|---|
diff --git a/summarizer/summarizer.rb b/summarizer/summarizer.rb
index abc1234..def5678 100644
--- a/summarizer/summarizer.rb
+++ b/summarizer/summarizer.rb
@@ -26,6 +26,6 @@ @summary = summary
erb = ERB.new(File.open("template.html.erb").read, 0, '>')
html = erb.result binding
-File.open(title.downcase + "_summary.html", "w").write(html)
+File.open(title.downcase.gsub(/\W+/, "_") + "_summary.html", "w").write(html)
-File.open(title.downcase + "_summary.json", "w").write(summary.to_h.to_json)
+File.open(title.downcase.gsub(/\W+/, "_") + "_summary.json", "w").write(summary.to_h.to_json)
|
Correct naming of generated files
In order to make titles nicer in the summaries a space was added. This wasn't fixed in the file names that needed to be parameterized.
|
diff --git a/config/schedule.rb b/config/schedule.rb
index abc1234..def5678 100644
--- a/config/schedule.rb
+++ b/config/schedule.rb
@@ -1,5 +1,6 @@ # This file is overwritten on deploy
set :output, {:error => 'log/cron.error.log', :standard => 'log/cron.log'}
+job_type :rake, 'cd :path && /usr/local/bin/govuk_setenv publisher bundle exec rake :task'
job_type :run_script, 'cd :path && RAILS_ENV=:environment /usr/local/bin/govuk_setenv publisher script/:task'
every 1.day, :at => '5am' do
|
Make whenever rake tasks run under govuk_setenv
This will fix the local_transactions import
|
diff --git a/obtuse.gemspec b/obtuse.gemspec
index abc1234..def5678 100644
--- a/obtuse.gemspec
+++ b/obtuse.gemspec
@@ -16,4 +16,10 @@ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
gem.require_paths = ["lib"]
+
+ gem.add_dependency "parslet"
+
+ %w{rspec guard-rspec simplecov pry}.each do |name|
+ gem.add_development_dependency name
+ end
end
|
Add parslet, rspec, guard-rspec, simplecov and pry gems.
|
diff --git a/activo-rails.gemspec b/activo-rails.gemspec
index abc1234..def5678 100644
--- a/activo-rails.gemspec
+++ b/activo-rails.gemspec
@@ -4,7 +4,7 @@
Gem::Specification.new do |s|
s.name = "activo-rails"
- s.version = Activo::Rails::VERSION
+ s.version = ActivoRails::VERSION
s.platform = Gem::Platform::RUBY
s.authors = ["Jon Wood"]
s.email = ["jon@blankpad.net"]
|
Update the gemspec to load version correctly
|
diff --git a/Casks/textexpander3.rb b/Casks/textexpander3.rb
index abc1234..def5678 100644
--- a/Casks/textexpander3.rb
+++ b/Casks/textexpander3.rb
@@ -3,8 +3,11 @@ sha256 '87859d7efcbfe479e7b78686d4d3f9be9983b2c7d68a6122acea10d4efbb1bfa'
url "http://cdn.smilesoftware.com/TextExpander_#{version}.zip"
+ name 'TextExpander'
homepage 'http://www.smilesoftware.com/TextExpander/index.html'
- license :unknown
+ license :commercial
app 'TextExpander.app'
+
+ zap :delete => '~/Library/Application Support/TextExpander/'
end
|
Textexpander3: Add zap, name and update license
|
diff --git a/lib/odd_even.rb b/lib/odd_even.rb
index abc1234..def5678 100644
--- a/lib/odd_even.rb
+++ b/lib/odd_even.rb
@@ -12,7 +12,9 @@ if (numbers[i] % 2 == 0)
numbers[i] = "even"
end
-
+ if (numbers[i] % 2 == 1)
+ numbers[i]= "odd"
+ end
i += 1
end
numbers
@@ -20,28 +22,3 @@ end
-
-=begin
-
-class FizzBuzz
- def initialize(high_limit)
- @high_limit = high_limit
- end
-
- def arrayify
- numbers = 1.upto(@high_limit).to_a
-
- i = 0
-
- while (i < numbers.length)
- if (numbers[i] % 3 == 0)
- numbers[i] = "Fizz"
- end
-
- i += 1
- end
-
- numbers
- end
-end
-=end
|
Replace odd numbers in the array with 'odd'
|
diff --git a/lib/ttt/game.rb b/lib/ttt/game.rb
index abc1234..def5678 100644
--- a/lib/ttt/game.rb
+++ b/lib/ttt/game.rb
@@ -4,6 +4,11 @@
def initialize(dir)
Dir.mkdir(dir)
+ Dir.chdir(dir) do
+ SPACES.each do |space|
+ Dir.mkdir(File.join(dir, space))
+ end
+ end
end
end
end
|
Make it pass. I'll stop committing tests + code separately now
|
diff --git a/spec/array_sink_spec.rb b/spec/array_sink_spec.rb
index abc1234..def5678 100644
--- a/spec/array_sink_spec.rb
+++ b/spec/array_sink_spec.rb
@@ -0,0 +1,8 @@+require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
+
+describe ArraySink do
+ it "stores rows in #data" do
+ subject << {:a => 1}
+ subject.data.should == [{:a => 1}]
+ end
+end
|
Add a spec for ArraySink.
|
diff --git a/spec/units/host_spec.rb b/spec/units/host_spec.rb
index abc1234..def5678 100644
--- a/spec/units/host_spec.rb
+++ b/spec/units/host_spec.rb
@@ -41,12 +41,12 @@ describe ".find_by" do
let(:hostname) { "www.minitrue.gov.uk" }
let(:other_hostname) { "www.minipax.gov.uk" }
+ let!(:host) { described_class.create hostname: hostname, site_id: 321 }
before do
described_class.create hostname: other_hostname, site_id: 123
- @host = described_class.create hostname: hostname, site_id: 321
end
- specify { expect(described_class.find_by(hostname: hostname)).to eq(@host) }
+ specify { expect(described_class.find_by(hostname: hostname)).to eq(host) }
end
end
|
Use let over instance variable
|
diff --git a/lib/candy_check/app_store/subscription_verification.rb b/lib/candy_check/app_store/subscription_verification.rb
index abc1234..def5678 100644
--- a/lib/candy_check/app_store/subscription_verification.rb
+++ b/lib/candy_check/app_store/subscription_verification.rb
@@ -14,6 +14,13 @@ VerificationFailure.fetch(@response['status'])
end
end
+
+ private
+
+ def valid?
+ status_is_ok = @response['status'] == STATUS_OK
+ @response && status_is_ok && @response['latest_receipt_info']
+ end
end
end
end
|
Create separate `valid?` method for `SubscriptionVerification`
Instead of checking that the `receipt` key is available, use the
`latest_receipt_info` key.
|
diff --git a/lib/gitlab/background_migration/migrate_stage_index.rb b/lib/gitlab/background_migration/migrate_stage_index.rb
index abc1234..def5678 100644
--- a/lib/gitlab/background_migration/migrate_stage_index.rb
+++ b/lib/gitlab/background_migration/migrate_stage_index.rb
@@ -4,18 +4,20 @@ module Gitlab
module BackgroundMigration
class MigrateStageIndex
- module Migratable
- class Stage < ActiveRecord::Base
- self.table_name = 'ci_stages'
+ def perform(start_id, stop_id)
+ migrate_stage_index_sql(start_id.to_i, stop_id.to_i).tap do |sql|
+ ActiveRecord::Base.connection.execute(sql)
end
end
- def perform(start_id, stop_id)
+ private
+
+ def migrate_stage_index_sql(start_id, stop_id)
if Gitlab::Database.postgresql?
- sql = <<~SQL
+ <<~SQL
WITH freqs AS (
SELECT stage_id, stage_idx, COUNT(*) AS freq FROM ci_builds
- WHERE stage_id BETWEEN #{start_id.to_i} AND #{stop_id.to_i}
+ WHERE stage_id BETWEEN #{start_id} AND #{stop_id}
AND stage_idx IS NOT NULL
GROUP BY stage_id, stage_idx
), indexes AS (
@@ -29,18 +31,16 @@ AND ci_stages.index IS NULL;
SQL
else
- sql = <<~SQL
+ <<~SQL
UPDATE ci_stages
SET index =
(SELECT stage_idx FROM ci_builds
WHERE ci_builds.stage_id = ci_stages.id
GROUP BY ci_builds.stage_idx ORDER BY COUNT(*) DESC LIMIT 1)
- WHERE ci_stages.id BETWEEN #{start_id.to_i} AND #{stop_id.to_i}
+ WHERE ci_stages.id BETWEEN #{start_id} AND #{stop_id}
AND ci_stages.index IS NULL
SQL
end
-
- ActiveRecord::Base.connection.execute(sql)
end
end
end
|
Improve stages index migration code readability
|
diff --git a/lib/arc42-pandoc/markdown/markdown_builder.rb b/lib/arc42-pandoc/markdown/markdown_builder.rb
index abc1234..def5678 100644
--- a/lib/arc42-pandoc/markdown/markdown_builder.rb
+++ b/lib/arc42-pandoc/markdown/markdown_builder.rb
@@ -23,7 +23,7 @@ chunks = files.group_by { |file| file.split('/')[-2] }
chunks.each { |lang, templates|
- puts "Templates available for language '#{lang}': \n * #{templates.map { |t| t.split('/')[-1] }.join("\n\t* ")}\n\n"
+ puts "Templates available for language '#{lang}': \n * #{templates.map { |t| t.split('/')[-1] }.join("\n * ")}\n\n"
}
end
|
Fix formatting issue in list command
|
diff --git a/lib/dnsimple/commands/describe_certificate.rb b/lib/dnsimple/commands/describe_certificate.rb
index abc1234..def5678 100644
--- a/lib/dnsimple/commands/describe_certificate.rb
+++ b/lib/dnsimple/commands/describe_certificate.rb
@@ -27,6 +27,7 @@ puts
puts "#{certificate.private_key}"
puts
+ puts "#{certificate.ssl_certificate}"
end
end
end
|
Include the ssl certificate in the output
|
diff --git a/lib/transam_funding/funding_funding_source.rb b/lib/transam_funding/funding_funding_source.rb
index abc1234..def5678 100644
--- a/lib/transam_funding/funding_funding_source.rb
+++ b/lib/transam_funding/funding_funding_source.rb
@@ -1,8 +1,10 @@ module FundingFundingSource
extend ActiveSupport::Concern
- has_many :funding_templates, :dependent => :destroy
- has_many :funding_buckets, :through => :funding_templates
+ included do
+ has_many :funding_templates, :dependent => :destroy
+ has_many :funding_buckets, :through => :funding_templates
+ end
#------------------------------------------------------------------------------
|
Add missing include block in FundingFundingSource extension
|
diff --git a/test/dimensions/test_case.rb b/test/dimensions/test_case.rb
index abc1234..def5678 100644
--- a/test/dimensions/test_case.rb
+++ b/test/dimensions/test_case.rb
@@ -1,10 +1,24 @@ require 'dimensions'
-require 'test/unit'
module Dimensions
FIXTURE_ROOT = File.expand_path('../../fixtures', __FILE__)
- class TestCase < Test::Unit::TestCase
+ begin
+ require 'minitest/autorun'
+ begin
+ # 2.0.0
+ class TestCase < MiniTest::Test; end
+ rescue NameError
+ # 1.9.3
+ class TestCase < MiniTest::Unit::TestCase; end
+ end
+ rescue LoadError
+ # 1.8.7
+ require 'test/unit'
+ class TestCase < Test::Unit::TestCase; end
+ end
+
+ class TestCase
undef_method(:default_test) if method_defined?(:default_test)
def with_fixture(filename, &block)
|
Fix tests on Ruby 2.0
|
diff --git a/prefnerd.gemspec b/prefnerd.gemspec
index abc1234..def5678 100644
--- a/prefnerd.gemspec
+++ b/prefnerd.gemspec
@@ -3,6 +3,7 @@ spec.version = '0.2'
spec.authors = ['Greg Hurrell']
spec.email = ['greg@hurrell.net']
+ spec.homepage = 'https://github.com/wincent/prefnerd'
spec.summary = %q{Monitors the OS X defaults database for changes}
spec.description = %q{
Are you an OS X prefnerd? Do you keep a base set of OS X preferences in
|
Add GitHub as homepage in gemspec
|
diff --git a/core/io/sysopen_spec.rb b/core/io/sysopen_spec.rb
index abc1234..def5678 100644
--- a/core/io/sysopen_spec.rb
+++ b/core/io/sysopen_spec.rb
@@ -6,39 +6,49 @@ @filename = tmp("rubinius-spec-io-sysopen-#{$$}.txt")
end
+ before :each do
+ @fd = nil
+ end
+
+ after :each do
+ IO.for_fd(@fd).close if @fd
+ end
+
after :all do
File.unlink @filename
end
-
it "returns the file descriptor for a given path" do
- fd = IO.sysopen(@filename, "w")
- fd.should be_kind_of(Fixnum)
- fd.should_not equal(0)
+ @fd = IO.sysopen(@filename, "w")
+ @fd.should be_kind_of(Fixnum)
+ @fd.should_not equal(0)
end
- it "works on directories" do
- fd = IO.sysopen(tmp("")) # /tmp
- fd.should be_kind_of(Fixnum)
- fd.should_not equal(0)
+ # opening a directory is not supported on Windows
+ platform_is_not :windows do
+ it "works on directories" do
+ @fd = IO.sysopen(tmp("")) # /tmp
+ @fd.should be_kind_of(Fixnum)
+ @fd.should_not equal(0)
+ end
end
ruby_version_is "1.9" do
it "calls #to_path on first argument" do
p = mock('path')
p.should_receive(:to_path).and_return(@filename)
- IO.sysopen(p, 'w')
+ @fd = IO.sysopen(p, 'w')
end
end
it "accepts a mode as second argument" do
- fd = 0
- lambda { fd = IO.sysopen(@filename, "w") }.should_not raise_error
- fd.should_not equal(0)
+ @fd = 0
+ lambda { @fd = IO.sysopen(@filename, "w") }.should_not raise_error
+ @fd.should_not equal(0)
end
it "accepts permissions as third argument" do
- fd = IO.sysopen(@filename, "w", 777)
- fd.should_not equal(0)
+ @fd = IO.sysopen(@filename, "w", 777)
+ @fd.should_not equal(0)
end
end
|
Fix IO.sysopen specs to clean afther themselves and make them pass on Windows
|
diff --git a/telemetry-logger.gemspec b/telemetry-logger.gemspec
index abc1234..def5678 100644
--- a/telemetry-logger.gemspec
+++ b/telemetry-logger.gemspec
@@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = 'telemetry-logger'
- s.version = '0.1.10'
+ s.version = '0.1.11'
s.summary = 'Logging to STDERR with coloring and levels of severity'
s.description = ' '
|
Package version is increased from 0.1.10 to 0.1.11
|
diff --git a/perf/models.rb b/perf/models.rb
index abc1234..def5678 100644
--- a/perf/models.rb
+++ b/perf/models.rb
@@ -6,7 +6,6 @@
embeds_one :name, :validate => false
embeds_many :addresses, :validate => false
- embeds_many :phones, :validate => false
has_many :posts, :validate => false
has_one :game, :validate => false
|
Remove phone relation from benchmark
|
diff --git a/spec/action_spec.rb b/spec/action_spec.rb
index abc1234..def5678 100644
--- a/spec/action_spec.rb
+++ b/spec/action_spec.rb
@@ -5,7 +5,7 @@ double('Launchboard::Receiver', :do => 'nothing')
end
let(:start_action) { 'music' }
- let(:end_action) { '' }
+ let(:end_action) { nil }
let(:action) do
Launchboard::Action.new(receiver, start_action, end_action)
end
|
Use nil for empty end_action in spec
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -28,5 +28,6 @@ Typhoeus.on_complete.clear
Typhoeus.on_success.clear
Typhoeus.on_failure.clear
+ Typhoeus::Config.verbose = false
end
end
|
Make sure verbose setting doesn't leak.
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -6,7 +6,10 @@ require 'knockoff'
ActiveRecord::Base.configurations = {
- 'test' => { 'adapter' => 'sqlite3', 'database' => 'tmp/test_db' }
+ test: {
+ adapter: 'sqlite3',
+ database: 'tmp/test_db'
+ }
}
# Setup the ENV's for replicas
|
Use symbols in the configuration hash
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -7,4 +7,8 @@
config.filter_run focus: true
config.run_all_when_everything_filtered = true
+
+ config.before :suite do
+ Adhearsion::Logging.start Adhearsion::Logging.default_appenders, :trace, Adhearsion.config.platform.logging.formatter
+ end
end
|
[CS] Include logs in spec output
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,3 +1,9 @@ require 'erb_helper'
require 'bundler/setup'
require 'vcloud/net_launcher'
+
+RSpec.configure do |config|
+ config.expect_with :rspec do |c|
+ c.syntax = :expect
+ end
+end
|
Disable `should` syntax in Rspec
`should` syntax is deprecated as of Rspec version 3.0 and the previous
commit converts all of our tests to use `expect` for consistency.
To prevent regressions, this change disables `should` syntax for this
gem.
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -9,7 +9,11 @@ end
add_group 'Tasks', 'lib/agharta/tasks'
add_group 'UsetStream', 'lib/agharta/user_stream'
- add_group 'Handlers', 'lib/agharta/handlers'
+ add_group 'Handlers' do |source|
+ source.filename =~ /lib\/agharta\/handlers/ ||
+ source.filename =~ /lib\/agharta\/notifies/ ||
+ source.filename =~ /lib\/agharta\/stores/
+ end
end
end
|
Add handler group pattern at simplecov.
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -19,8 +19,11 @@ end
SimpleCov.start do
- # Don't get coverage on the test cases themselves
+ # Don't get coverage on the test cases themselves.
+ add_filter '/spec/'
add_filter '/test/'
+ # Codecov doesn't automatically ignore vendored files.
+ add_filter '/vendor/'
end
require 'halite'
|
Add a few more default filters.
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -23,24 +23,3 @@ PuppetlabsSpec::Files.cleanup
end
end
-
-require 'pathname'
-dir = Pathname.new(__FILE__).parent
-Puppet[:modulepath] = File.join(dir, 'fixtures', 'modules')
-
-# There's no real need to make this version dependent, but it helps find
-# regressions in Puppet
-#
-# 1. Workaround for issue #16277 where default settings aren't initialised from
-# a spec and so the libdir is never initialised (3.0.x)
-# 2. Workaround for 2.7.20 that now only loads types for the current node
-# environment (#13858) so Puppet[:modulepath] seems to get ignored
-# 3. Workaround for 3.5 where context hasn't been configured yet,
-# ticket https://tickets.puppetlabs.com/browse/MODULES-823
-#
-ver = Gem::Version.new(Puppet.version.split('-').first)
-if Gem::Requirement.new("~> 2.7.20") =~ ver || Gem::Requirement.new("~> 3.0.0") =~ ver || Gem::Requirement.new("~> 3.5") =~ ver
- puts "augeasproviders: setting Puppet[:libdir] to work around broken type autoloading"
- # libdir is only a single dir, so it can only workaround loading of one external module
- Puppet[:libdir] = "#{Puppet[:modulepath]}/augeasproviders_core/lib"
-end
|
Use modulesync to manage meta files
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -4,6 +4,7 @@
class Rack::MockRequest
def trace(uri, opts={}) request("TRACE", uri, opts) end
+ def options(uri, opts={}) request("TRACE", uri, opts) end
end
def extended_modules_for kls
|
Add options to rack mock request
|
diff --git a/lib/marooned/finder.rb b/lib/marooned/finder.rb
index abc1234..def5678 100644
--- a/lib/marooned/finder.rb
+++ b/lib/marooned/finder.rb
@@ -3,10 +3,7 @@ def find(directory)
search_path = File.join(directory, "**/*")
files = Dir.glob(search_path)
- files = files.select do |file|
- File.file? file
- end
-
+ files = files.select(&method(:filter_absolute_paths))
files = relative_paths(files, directory)
files = files.reject(&method(:file_filter))
absolute_paths(files, directory)
@@ -16,6 +13,14 @@
def file_filter(file)
regex.match(file)
+ end
+
+ def filter_absolute_paths(path)
+ if absolute_regex.match(path)
+ return true
+ end
+
+ File.file? path
end
def absolute_paths(files, directory)
@@ -30,6 +35,14 @@ end
end
+ def absolute_regex
+ Regexp.union(
+ [
+ /\/[^\/]*.xcdatamodel$/,
+ ]
+ )
+ end
+
def regex
Regexp.union(
[
@@ -39,6 +52,10 @@ /\.xcassets\/.*$/,
/\.xcodeproj\/.*$/,
/\.xcworkspace\/.*$/,
+ /Gemfile(\.lock)?$/,
+ /Podfile(\.lock)?$/,
+ /^bin\/.*$/,
+ /\.xcdatamodel\/contents$/,
]
)
end
|
Allow filtering of absolute paths
This fixes an issue with xcdatamodel files since they are included as a
directory not as the file inside of them
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -6,6 +6,9 @@ # Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
+
+# Seed the database with the standard values.
+SeedFu.seed
RSpec.configure do |config|
# == Mock Framework
|
Apply database seeds before running specs.
|
diff --git a/lib/sports_data_api.rb b/lib/sports_data_api.rb
index abc1234..def5678 100644
--- a/lib/sports_data_api.rb
+++ b/lib/sports_data_api.rb
@@ -1,6 +1,7 @@ require "sports_data_api/version"
require "nokogiri"
require "rest_client"
+require "time"
module SportsDataApi
def self.key
|
Fix "undefined method `parse' for Time:Class"
|
diff --git a/core/db/migrate/20150623214058_seed_store_credit_update_reasons.rb b/core/db/migrate/20150623214058_seed_store_credit_update_reasons.rb
index abc1234..def5678 100644
--- a/core/db/migrate/20150623214058_seed_store_credit_update_reasons.rb
+++ b/core/db/migrate/20150623214058_seed_store_credit_update_reasons.rb
@@ -4,6 +4,6 @@ end
def down
- # intentionally left blank
+ Spree::StoreCreditUpdateReason.find_by(name: 'Credit Given In Error').try!(:destroy)
end
end
|
Destroy record in down migration
|
diff --git a/lib/tubesock/hijack.rb b/lib/tubesock/hijack.rb
index abc1234..def5678 100644
--- a/lib/tubesock/hijack.rb
+++ b/lib/tubesock/hijack.rb
@@ -33,7 +33,7 @@ ActiveRecord::Base.clear_active_connections! if defined? ActiveRecord
end
sock.listen
- render text: nil, status: -1
+ render plain: nil, status: -1
end
end
end
|
Use `render plain` instead of `render text` for Rails 5.1
|
diff --git a/spec/features/geolocation_alert_spec.rb b/spec/features/geolocation_alert_spec.rb
index abc1234..def5678 100644
--- a/spec/features/geolocation_alert_spec.rb
+++ b/spec/features/geolocation_alert_spec.rb
@@ -16,7 +16,7 @@ button = page.find('.joined-link', match: :first)
button.click
click_on 'Create Hangout'
- sleep 1 # Required for test to pass
+ sleep 2 # Required for test to pass
expect(page).to have_content 'Warning'
end
end
|
Change sleep back to 2 seconds
|
diff --git a/test/models/user_test.rb b/test/models/user_test.rb
index abc1234..def5678 100644
--- a/test/models/user_test.rb
+++ b/test/models/user_test.rb
@@ -0,0 +1,43 @@+require 'test_helper'
+
+describe User do
+
+ let(:auth_hash) {
+ {
+ provider: 'google',
+ uid: '12345',
+ info: {
+ name: 'Stub User',
+ email: 'stub.user@example.org',
+ image: 'http://example.org/image.jpg',
+ }
+ }
+ }
+
+ it 'can be created from an auth hash' do
+ user = User.find_or_create_from_auth_hash(auth_hash)
+
+ assert_equal 'Stub User', user.name
+ assert_equal 'stub.user@example.org', user.email
+ assert_equal 'google', user.provider
+ assert_equal '12345', user.provider_uid
+ assert_equal 'http://example.org/image.jpg', user.image_url
+ end
+
+ it 'can be found from a matching email' do
+ existing_user = create(:user, email: auth_hash[:info][:email])
+ user = User.find_or_create_from_auth_hash(auth_hash)
+
+ assert_equal existing_user.id, user.id
+ end
+
+ it 'updates the user details on sign in' do
+ existing_user = create(:user, email: auth_hash[:info][:email],
+ name: 'Another Name')
+ User.find_or_create_from_auth_hash(auth_hash)
+
+ existing_user.reload
+ assert_equal 'Stub User', existing_user.name
+ end
+
+end
|
Add tests for building a User from an auth hash
|
diff --git a/test/mysql_import_test.rb b/test/mysql_import_test.rb
index abc1234..def5678 100644
--- a/test/mysql_import_test.rb
+++ b/test/mysql_import_test.rb
@@ -11,7 +11,7 @@ end
test 'success' do
- client = MysqlImport.new(DbConfig.to_hash)
+ client = MysqlImport.new(DbConfig.to_hash, sql_opts: { local_infile: true })
client.add(File.expand_path('../csv/users_valid.csv', __FILE__), table: 'users')
client.import
end
|
:green_heart: Add option for Travis CI test
|
diff --git a/spec/electric_sheep/shell/resourceful_spec.rb b/spec/electric_sheep/shell/resourceful_spec.rb
index abc1234..def5678 100644
--- a/spec/electric_sheep/shell/resourceful_spec.rb
+++ b/spec/electric_sheep/shell/resourceful_spec.rb
@@ -0,0 +1,40 @@+require 'spec_helper'
+
+describe ElectricSheep::Shell::Resourceful do
+
+ ResourcefulKlazz = Class.new do
+ include ElectricSheep::Shell::Resourceful
+
+ def initialize
+ @host=ElectricSheep::Metadata::Host.new
+ end
+
+ end
+
+ describe ResourcefulKlazz do
+
+ def assert_resource_created(type, klazz, local_expected)
+ ResourcefulKlazz.any_instance.stubs(:local?).returns local_expected
+ resource=subject.new.send "#{type}_resource", path: '/some/path'
+ resource.must_be_instance_of klazz
+ resource.path.must_equal '/some/path'
+ resource.host.send local_expected ? :must_be : :wont_be, :local?
+ end
+
+ def self.describe_resource_creation(type, klazz)
+ describe "creating a #{type} resource" do
+ it 'merges the options and defaults to localhost' do
+ assert_resource_created type, klazz, true
+ end
+
+ it 'merges the options and keep the provided host if remote' do
+ assert_resource_created type, klazz, false
+ end
+ end
+ end
+
+ describe_resource_creation 'directory', ElectricSheep::Resources::Directory
+ describe_resource_creation 'file', ElectricSheep::Resources::File
+
+ end
+end
|
Add missing spec of resourceful module
|
diff --git a/script/marriage-abroad-countries-leading-to-outcome.rb b/script/marriage-abroad-countries-leading-to-outcome.rb
index abc1234..def5678 100644
--- a/script/marriage-abroad-countries-leading-to-outcome.rb
+++ b/script/marriage-abroad-countries-leading-to-outcome.rb
@@ -0,0 +1,17 @@+outcome_name = ARGV.shift
+
+filename = 'marriage-abroad-responses-and-expected-results.yml'
+filepath = Rails.root.join('test', 'data', filename)
+
+yaml = File.read(filepath)
+responses_and_expected_results = YAML.load(yaml)
+
+data_for_outcome = responses_and_expected_results.select do |hash|
+ hash[:next_node] == outcome_name.to_sym
+end
+responses_for_outcome = data_for_outcome.map do |hash|
+ hash[:responses]
+end
+countries_for_outcome = responses_for_outcome.map(&:first).uniq
+
+puts countries_for_outcome
|
Add script to list countries leading to outcome
This displays the countries that lead to the given outcome.
It's going to help me when extracting the marriage-abroad services from the
templates.
|
diff --git a/spec/prepare.rb b/spec/prepare.rb
index abc1234..def5678 100644
--- a/spec/prepare.rb
+++ b/spec/prepare.rb
@@ -26,4 +26,16 @@ assert $first, :==, true
assert $second, :==, false
end
+
+ scope 'second level scope' do
+ prepare do
+ $second = true
+ end
+
+ spec 'call prepare blocks from file level scope to second level scope' do
+ assert $file, :==, true
+ assert $first, :==, true
+ assert $second, :==, true
+ end
+ end
end
|
Call Prepare blocks from file level scope to second level scope.
|
diff --git a/pieces.gemspec b/pieces.gemspec
index abc1234..def5678 100644
--- a/pieces.gemspec
+++ b/pieces.gemspec
@@ -16,11 +16,11 @@ spec.executables = ['pieces']
spec.require_paths = ['lib']
- spec.add_dependency 'mustache'
spec.add_dependency 'tilt', '~> 2.0.1'
spec.add_development_dependency 'bundler'
+ spec.add_development_dependency 'codeclimate-test-reporter'
+ spec.add_development_dependency 'mustache'
spec.add_development_dependency 'rake'
spec.add_development_dependency 'rspec'
- spec.add_development_dependency 'codeclimate-test-reporter'
end
|
Move mustache to development dependency
|
diff --git a/init.rb b/init.rb
index abc1234..def5678 100644
--- a/init.rb
+++ b/init.rb
@@ -23,7 +23,7 @@ permission :delete_gollum_wiki, :gollum => [:destroy]
end
- menu :project_menu, :gollum_wiki, { :controller => :gollum, :action => :index }, :caption => 'Wiki', :after => 'Issues', :param => :project_id
+ menu :project_menu, :gollum, { :controller => :gollum, :action => :index }, :caption => 'Gollum Wiki', :before => :wiki, :param => :project_id
end
Redmine::Activity.map do |activity|
|
Rename tab to 'Gollum Wiki', fix it to be selected, place before :wiki.
|
diff --git a/init.rb b/init.rb
index abc1234..def5678 100644
--- a/init.rb
+++ b/init.rb
@@ -1,3 +1,7 @@+if ActionPack::VERSION::STRING == "2.3.6"
+ raise "rails_xss does not support Rails 2.3.6. Please upgrade to Rails 2.3.6.1 or later."
+end
+
unless $gems_rake_task
require 'rails_xss/plugin'
end
|
Add an error message for Rails 2.3.6.
|
diff --git a/server.rb b/server.rb
index abc1234..def5678 100644
--- a/server.rb
+++ b/server.rb
@@ -1,10 +1,6 @@ class HelloWorldApp < Sinatra::Base
configure do
set :protection, :except => :frame_options
- end
-
- get '/' do
- "Hello, world!"
end
get '/button' do
|
Remove "/" route since we dont need it
|
diff --git a/server.rb b/server.rb
index abc1234..def5678 100644
--- a/server.rb
+++ b/server.rb
@@ -13,7 +13,7 @@ thread = nil
ws.onmessage {|msg|
ts.each {|t| t[:queue].push(msg) }
- p ts
+ p msg
}
ws.onopen {
thread = Thread.new {
|
Print a message when it comes.
|
diff --git a/test/appharbor_test.rb b/test/appharbor_test.rb
index abc1234..def5678 100644
--- a/test/appharbor_test.rb
+++ b/test/appharbor_test.rb
@@ -5,10 +5,17 @@ @stubs = Faraday::Adapter::Test::Stubs.new
end
- def test_push
- application_slug = 'foo'
- token = 'bar'
+ def test_single_slug_push
+ test_push 'foo', 'bar'
+ end
+ def service(*args)
+ super Service::AppHarbor, *args
+ end
+
+private
+
+ def test_push(application_slug, token)
@stubs.post "/application/#{application_slug}/build" do |env|
verify_appharbor_payload(token, env)
end
@@ -18,12 +25,6 @@
@stubs.verify_stubbed_calls
end
-
- def service(*args)
- super Service::AppHarbor, *args
- end
-
-private
def verify_appharbor_payload(token, env)
assert_equal token, env[:params]['authorization']
|
Move logic for testing push to private method
|
diff --git a/test/weblate_test.rb b/test/weblate_test.rb
index abc1234..def5678 100644
--- a/test/weblate_test.rb
+++ b/test/weblate_test.rb
@@ -0,0 +1,22 @@+class WeblateTest < Service::TestCase
+ def setup
+ @stubs = Faraday::Adapter::Test::Stubs.new
+ end
+
+ def test_push
+ @stubs.post "/hooks/github/" do |env|
+ assert_equal 'weblate.example.org', env[:url].host
+ assert_equal 'application/json',
+ env[:request_headers]['content-type']
+ [200, {}, '']
+ end
+
+ svc = service :push,
+ {'url' => 'weblate.example.org'}, payload
+ svc.receive_push
+ end
+
+ def service(*args)
+ super Service::Weblate, *args
+ end
+end
|
Add testcase for Weblate service
|
diff --git a/app/helpers/matrices_helper.rb b/app/helpers/matrices_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/matrices_helper.rb
+++ b/app/helpers/matrices_helper.rb
@@ -22,10 +22,10 @@ def kind_submission_list
@kinds = kind_list
- @kinds.each { |kind|
- if kind.include? "Sequence" or kind.include? "Duplicate"
- @kinds.delete(kind)
- end
+ @kinds.delete_if { |kind|
+ (kind.include? "Sequence") or
+ (kind.include? "Duplicate") or
+ (kind.include? "Subsequent")
}
# Add an option for an "Other" kind if the submission is really different
|
Remove "Subsequent" kinds from matrix submission options
|
diff --git a/lib/active_record/mass_assignment_security/inheritance.rb b/lib/active_record/mass_assignment_security/inheritance.rb
index abc1234..def5678 100644
--- a/lib/active_record/mass_assignment_security/inheritance.rb
+++ b/lib/active_record/mass_assignment_security/inheritance.rb
@@ -12,6 +12,8 @@ def subclass_from_attributes?(attrs)
active_authorizer[:default].deny?(inheritance_column) ? nil : super
end
+ # Support Active Record <= 4.0.3, which uses the old method signature.
+ alias_method :subclass_from_attrs, :subclass_from_attributes?
end
end
end
|
Support Active Record <= 4.0.3, which uses the old method signature
|
diff --git a/roles/db-slave.rb b/roles/db-slave.rb
index abc1234..def5678 100644
--- a/roles/db-slave.rb
+++ b/roles/db-slave.rb
@@ -14,7 +14,7 @@ :user => "replication",
:passwords => { :bag => "db", :item => "passwords" }
},
- :restore_command => "/usr/local/bin/openstreetmap-wal-e --terse wal-fetch %f %p"
+ :restore_command => "/usr/local/bin/openstreetmap-wal-g wal-fetch %f %p"
}
}
}
|
Switch slave databases to use wal-g instead of wal-e
|
diff --git a/app/helpers/games_helper.rb b/app/helpers/games_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/games_helper.rb
+++ b/app/helpers/games_helper.rb
@@ -6,6 +6,6 @@ private
def random_placeholder
- Game.where.not(shortname: nil).offset(rand(Game.where.not(shortname: nil).count)).first
+ @random_placeholder ||= Game.where.not(shortname: nil).offset(rand(Game.where.not(shortname: nil).count)).first
end
end
|
Fix search placeholder name/shortname being two different games
|
diff --git a/app/models/gobierto_data.rb b/app/models/gobierto_data.rb
index abc1234..def5678 100644
--- a/app/models/gobierto_data.rb
+++ b/app/models/gobierto_data.rb
@@ -8,4 +8,8 @@ def self.classes_with_custom_fields
[GobiertoData::Dataset]
end
+
+ def self.root_path(current_site)
+ Rails.application.routes.url_helpers.gobierto_data_root_path
+ end
end
|
Implement root_path in gobierto data module
|
diff --git a/app/models/jodel_handler.rb b/app/models/jodel_handler.rb
index abc1234..def5678 100644
--- a/app/models/jodel_handler.rb
+++ b/app/models/jodel_handler.rb
@@ -14,7 +14,12 @@
def loudest_post(latitude, longitude)
response = get_posts(latitude, longitude)
- response["voted"][0]
+ puts response
+ if response["voted"].nil?
+ {"vote_count" => 0, "message" => "(Kein Jodel gefunden. Schau in 5 Minuten nochmal vorbei.)"}
+ else
+ response["voted"][0]
+ end
end
end
|
Fix crash if no jodels available
|
diff --git a/app/models/system_system.rb b/app/models/system_system.rb
index abc1234..def5678 100644
--- a/app/models/system_system.rb
+++ b/app/models/system_system.rb
@@ -17,13 +17,13 @@
def does_not_link_to_self
if parent_id == child_id
- errors.add(:base, "System cannot be its own sub-system")
+ errors.add(:base, "System cannot rely on itself.")
end
end
def does_not_create_cycles
if has_cycle_to_parent?
- errors.add(:base, "Creates cycle in system graph")
+ errors.add(:base, "Cannot link to Systems that rely on this System.")
end
end
|
Change error messages for system-system links to be clearer [story:42834235]
|
diff --git a/app/api/bookyt/api.rb b/app/api/bookyt/api.rb
index abc1234..def5678 100644
--- a/app/api/bookyt/api.rb
+++ b/app/api/bookyt/api.rb
@@ -13,12 +13,8 @@ end
rescue_from ActiveRecord::RecordInvalid do |error|
- error = {
- 'status' => 422,
- 'message' => error.record.errors.full_messages.to_sentence,
- 'errors' => error.record.errors,
- }
- Rack::Response.new(error.to_json, 422)
+ message = { 'error' => error.record.errors.full_messages }
+ Rack::Response.new(message.to_json, 422)
end
mount Bookyt::API::Bookings
|
Return validation errors in a consistent way
|
diff --git a/rb/lib/selenium/webdriver/firefox/bridge.rb b/rb/lib/selenium/webdriver/firefox/bridge.rb
index abc1234..def5678 100644
--- a/rb/lib/selenium/webdriver/firefox/bridge.rb
+++ b/rb/lib/selenium/webdriver/firefox/bridge.rb
@@ -6,9 +6,9 @@ class Bridge < Remote::Bridge
def initialize(opts = {})
- port = opts.fetch :port, DEFAULT_PORT
- profile = opts.delete :profile
- http_client = opts.delete :http_client
+ port = opts.delete(:port) || DEFAULT_PORT
+ profile = opts.delete(:profile)
+ http_client = opts.delete(:http_client)
@launcher = create_launcher(port, profile)
|
JariBakken: Make sure opts is empty when we validate the options passed.
r11124
|
diff --git a/week-4/factorial/my_solution.rb b/week-4/factorial/my_solution.rb
index abc1234..def5678 100644
--- a/week-4/factorial/my_solution.rb
+++ b/week-4/factorial/my_solution.rb
@@ -14,7 +14,7 @@ else
result= 1
i = number
- while i > 1
+ while i > 0
result = result * i
i= i - 1
end
|
Create factorial files with codes
|
diff --git a/searchify.gemspec b/searchify.gemspec
index abc1234..def5678 100644
--- a/searchify.gemspec
+++ b/searchify.gemspec
@@ -16,7 +16,7 @@ s.files = Dir["{app,config,db,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.md"]
s.test_files = Dir["test/**/*"]
- s.add_dependency "rails", "~> 3.1.1"
+ s.add_dependency "rails"
s.add_dependency "jquery-rails"
s.add_development_dependency "sqlite3"
|
Update rails dependency in order to work with Rails 3.2 RC1
|
diff --git a/spec/celluloid/supervision_group_spec.rb b/spec/celluloid/supervision_group_spec.rb
index abc1234..def5678 100644
--- a/spec/celluloid/supervision_group_spec.rb
+++ b/spec/celluloid/supervision_group_spec.rb
@@ -55,5 +55,11 @@ Celluloid::Actor[:example_pool].args.should eq ['foo']
Celluloid::Actor[:example_pool].size.should be 3
end
+
+ it "allows external access to the internal registry" do
+ supervisor = MyGroup.run!
+
+ supervisor[:example].should be_a MyActor
+ end
end
end
|
Add spec for internal registry access
|
diff --git a/spec/controllers/user_controller_spec.rb b/spec/controllers/user_controller_spec.rb
index abc1234..def5678 100644
--- a/spec/controllers/user_controller_spec.rb
+++ b/spec/controllers/user_controller_spec.rb
@@ -0,0 +1,56 @@+require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
+
+describe UserController do
+
+ describe 'GET signchangeaddress' do
+
+ render_views
+
+ it "redirects an anonymous request to the signin page" do
+ get :signchangeaddress
+ expect(response).to redirect_to(signin_path(:token => PostRedirect.last.token))
+ end
+
+ it "displays the address template" do
+ user = FactoryGirl.create(:user, :dob => '2/2/2000')
+ session[:user_id] = user.id
+ get :signchangeaddress
+ expect(response).to render_template('signchangeaddress')
+ end
+
+ context 'when supplied with the "submitted_signchangeaddress_do" param' do
+
+ it "sets the user's address" do
+ user = FactoryGirl.create(:user, :dob => '2/2/2000')
+ session[:user_id] = user.id
+ get :signchangeaddress, {:submitted_signchangeaddress_do => 1,
+ :signchangeaddress =>
+ {:new_address => 'some address' }}
+ expect(User.where(:id => user.id).first.address).to eq("some address")
+ end
+
+ it 'shows a notice' do
+ user = FactoryGirl.create(:user, :dob => '2/2/2000')
+ session[:user_id] = user.id
+ get :signchangeaddress, {:submitted_signchangeaddress_do => 1,
+ :signchangeaddress =>
+ {:new_address => 'some address' }}
+ message = 'You have now changed your address used on Alaveteli'
+ expect(flash[:notice]).to eq(message)
+ end
+
+ it "redirects to the user's page" do
+ user = FactoryGirl.create(:user, :dob => '2/2/2000')
+ session[:user_id] = user.id
+ get :signchangeaddress, {:submitted_signchangeaddress_do => 1,
+ :signchangeaddress =>
+ {:new_address => 'some address' }}
+ expected_url = show_user_path(:url_name => user.url_name)
+ expect(response).to redirect_to(expected_url)
+ end
+
+ end
+
+ end
+
+end
|
Add specs for custom signchangeaddress action.
|
diff --git a/spec/features/course/duplication_spec.rb b/spec/features/course/duplication_spec.rb
index abc1234..def5678 100644
--- a/spec/features/course/duplication_spec.rb
+++ b/spec/features/course/duplication_spec.rb
@@ -0,0 +1,67 @@+# frozen_string_literal: true
+require 'rails_helper'
+
+RSpec.feature 'Course: Duplication' do
+ let!(:instance) { Instance.default }
+
+ with_tenant(:instance) do
+ let!(:course) { create(:course) }
+
+ before do
+ login_as(user, scope: :user)
+ end
+
+ context 'As a System Administrator' do
+ let(:user) { create(:administrator) }
+
+ scenario 'I can view the Duplication Sidebar item' do
+ visit course_path(course)
+
+ expect(page).to have_selector('li', text: 'layouts.duplication.title')
+ end
+
+ scenario 'I can duplicate a course' do
+ visit course_duplication_path(course)
+
+ expect(page).to have_field('New course start date')
+ expect(page).to have_field('New course title')
+
+ expect { click_button I18n.t('course.duplications.show.duplicate') }.
+ to change { instance.courses.count }.by(1)
+ # After duplicating, go back to the duplication page
+ expect(current_path).to eq(course_duplication_path(course))
+ end
+ end
+
+ context 'As a Course Administrator' do
+ let(:user) { create(:course_manager, course: course).user }
+
+ scenario 'I cannot view the Duplication Sidebar item but can duplicate a course' do
+ visit course_path(course)
+
+ expect(page).not_to have_selector('li', text: 'layouts.duplication.title')
+
+ visit course_duplication_path(course)
+
+ # Just test that the Duplicate form can be seen since the actual duplication is already
+ # tested under the System Administrator context.
+ expect(page).to have_field('New course start date')
+ expect(page).to have_field('New course title')
+ end
+ end
+
+ context 'As a Course Student' do
+ let(:user) { create(:course_student, course: course).user }
+
+ scenario 'I cannot view the Duplication Sidebar item and cannot duplicate a course' do
+ visit course_path(course)
+
+ expect(page).not_to have_selector('li', text: 'layouts.duplication.title')
+
+ visit course_duplication_path(course)
+
+ expect(page.status_code).to eq(403)
+ end
+ end
+ end
+end
|
Add feature spec for duplication.
|
diff --git a/event_store-client-http.gemspec b/event_store-client-http.gemspec
index abc1234..def5678 100644
--- a/event_store-client-http.gemspec
+++ b/event_store-client-http.gemspec
@@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = 'event_store-client-http'
- s.version = '0.1.1.1'
+ s.version = '0.2.0.0'
s.summary = 'HTTP Client for EventStore'
s.description = ' '
|
Package version increased from 0.1.1.1 to 0.2.0.0
|
diff --git a/provisioner/spec/provider_spec.rb b/provisioner/spec/provider_spec.rb
index abc1234..def5678 100644
--- a/provisioner/spec/provider_spec.rb
+++ b/provisioner/spec/provider_spec.rb
@@ -1,5 +1,32 @@ require 'spec_helper'
+require 'json'
describe Provider do
+ response = IO.read("#{File.dirname(__FILE__)}/task.json")
+
+ # Set these up once
+ before :all do
+ %w(create confirm delete).each do |taskname|
+ instance_variable_set("@task_#{taskname}", JSON.parse(response.to_str.gsub('BOOTSTRAP', taskname)))
+ instance_variable_set("@provider_#{taskname}", Provider.new(instance_variable_get("@task_#{taskname}")))
+ end
+ end
+
+ %w(create confirm delete).each do |taskname|
+ @task = instance_variable_get("@task_#{taskname}")
+ context "when taskName is #{taskname}" do
+ describe '#new' do
+ it "creates an instance of Provider" do
+ expect(instance_variable_get("@provider_#{taskname}")).to be_an_instance_of Provider
+ end
+ it "creates task instance variable" do
+ expect(instance_variable_get("@provider_#{taskname}").task).to eql instance_variable_get("@task_#{taskname}")
+ end
+ it "creates empty result hash" do
+ expect(instance_variable_get("@provider_#{taskname}").result).to be_empty
+ end
+ end
+ end
+ end
end
|
Test Provider for create, confirm, and delete to create an instance of Provider with a task instance variable equaling the task hash and an empty result hash
|
diff --git a/rubygems-openpgp.gemspec b/rubygems-openpgp.gemspec
index abc1234..def5678 100644
--- a/rubygems-openpgp.gemspec
+++ b/rubygems-openpgp.gemspec
@@ -12,5 +12,5 @@ "lib/rubygems/commands/sbuild_command.rb",
"lib/rubygems/commands/sign_command.rb",
"lib/rubygems/gem_openpgp.rb"]
- s.homepage = 'http://www.grant-olson.net'
+ s.homepage = 'https://github.com/grant-olson/rubygems-openpgp'
end
|
Use github homepage instead of personal
|
diff --git a/cuba-contrib.gemspec b/cuba-contrib.gemspec
index abc1234..def5678 100644
--- a/cuba-contrib.gemspec
+++ b/cuba-contrib.gemspec
@@ -18,5 +18,5 @@
s.add_dependency "cuba", "~> 3.1"
s.add_development_dependency "cutest"
- s.add_development_dependency "mote", "~> 1.0"
+ s.add_dependency "mote", "~> 1.0"
end
|
Add mote as a runtime dependency
Mote is not a development dependency, as cuba/contrib requires
cuba/mote, which in turn requires mote.
|
diff --git a/schema.gemspec b/schema.gemspec
index abc1234..def5678 100644
--- a/schema.gemspec
+++ b/schema.gemspec
@@ -2,7 +2,7 @@ Gem::Specification.new do |s|
s.name = 'schema'
s.summary = "Primitives for schema and structure"
- s.version = '0.2.0.0'
+ s.version = '0.3.0.0'
s.description = ' '
s.authors = ['The Eventide Project']
|
Package version is increased from 0.2.0.0 to 0.3.0.0
|
diff --git a/attributes/default.rb b/attributes/default.rb
index abc1234..def5678 100644
--- a/attributes/default.rb
+++ b/attributes/default.rb
@@ -1,4 +1,6 @@ default['cron']['package_name'] = case node['platform_family']
+ when 'debian'
+ ['cron']
when 'rhel', 'fedora'
node['platform_version'].to_f >= 6.0 ? ['cronie'] : ['vixie-cron']
when 'solaris2'
|
Make sure cron is installed on Debian / Ubuntu
|
diff --git a/guard-zeus.gemspec b/guard-zeus.gemspec
index abc1234..def5678 100644
--- a/guard-zeus.gemspec
+++ b/guard-zeus.gemspec
@@ -12,11 +12,11 @@ gem.summary = %q{Pushes watched files to Zeus}
gem.homepage = "http://github.com/qnm/guard-zeus"
- gem.add_dependency 'guard'
- gem.add_dependency 'zeus'
+ gem.add_runtime_dependency 'guard', '~> 1.0'
+ gem.add_runtime_dependency 'zeus', '~> 0'
- gem.add_development_dependency 'bundler', '>= 1.0'
- gem.add_development_dependency 'rspec', '>= 2.0'
+ gem.add_development_dependency 'bundler', '~> 1.0'
+ gem.add_development_dependency 'rspec', '~> 2.0'
gem.files = Dir.glob('{lib}/**/*') + %w[LICENSE README.md]
gem.require_path = 'lib'
|
Add a dependency on guard version 1, to prepare the migration to version 2
|
diff --git a/sicuro.gemspec b/sicuro.gemspec
index abc1234..def5678 100644
--- a/sicuro.gemspec
+++ b/sicuro.gemspec
@@ -6,18 +6,18 @@ s.name = 'sicuro'
s.version = Sicuro::VERSION
s.platform = Gem::Platform::RUBY
- s.authors = ['Nick Markwell']
- s.email = ['nick@duckinator.net']
+ s.authors = ['Nik Markwell']
+ s.email = ['nik@duckinator.net']
s.homepage = 'http://github.com/duckinator/sicuro'
s.summary = %q{Safe ruby code execution.}
s.description = %q{Safe ruby code execution in a standard ruby environment. Does not use a chroot, jail, etc. No special permissions required.}
s.add_runtime_dependency 'standalone', '~> 0.5.0'
- s.add_development_dependency "rake", '~> 10.0.3'
- s.add_development_dependency 'rspec', '~> 2.13.0'
- s.add_development_dependency 'simplecov', '~> 0.7.1'
- s.add_development_dependency 'bundler', '~> 1.3.0'
+ s.add_development_dependency "rake", '~> 10.1.1'
+ s.add_development_dependency 'rspec', '~> 2.14.0'
+ s.add_development_dependency 'simplecov', '~> 0.8.2'
+ s.add_development_dependency 'bundler', '~> 1.5.1'
s.add_development_dependency 'coveralls'
s.files = `git ls-files`.split("\n")
|
Update dependencies (and the spelling of my name :P) in gemspec.
|
diff --git a/db/migrate/20141028160511_remove_nickname_limit.rb b/db/migrate/20141028160511_remove_nickname_limit.rb
index abc1234..def5678 100644
--- a/db/migrate/20141028160511_remove_nickname_limit.rb
+++ b/db/migrate/20141028160511_remove_nickname_limit.rb
@@ -0,0 +1,9 @@+class RemoveNicknameLimit < ActiveRecord::Migration
+ def self.up
+ change_column :profiles, :nickname, :string, :limit => 255
+ end
+
+ def self.down
+ change_column :profiles, :nickname, :string, :limit => 16
+ end
+end
|
Remove nickname limit on db
|
diff --git a/db/migrate/20180731153536_drop_political_groups.rb b/db/migrate/20180731153536_drop_political_groups.rb
index abc1234..def5678 100644
--- a/db/migrate/20180731153536_drop_political_groups.rb
+++ b/db/migrate/20180731153536_drop_political_groups.rb
@@ -0,0 +1,19 @@+# frozen_string_literal: true
+
+class DropPoliticalGroups < ActiveRecord::Migration[5.2]
+ def up
+ drop_table :gp_political_groups
+ end
+
+ def down
+ create_table :gp_political_groups do |t|
+ t.references :site
+ t.references :admin
+ t.string :name, null: false, default: ""
+ t.integer :position, default: 0, null: false
+ t.string :slug, default: "", null: false
+
+ t.timestamps
+ end
+ end
+end
|
Add migration to drop gp_political_groups table
|
diff --git a/lib/generators/link_to_action/install_generator.rb b/lib/generators/link_to_action/install_generator.rb
index abc1234..def5678 100644
--- a/lib/generators/link_to_action/install_generator.rb
+++ b/lib/generators/link_to_action/install_generator.rb
@@ -32,8 +32,9 @@
def copy_templates
['edit', 'index', 'new', 'show'].each do |action|
- copy_file "#{action}.html.erb",
- "lib/templates/erb/scaffold/#{action}.html.erb"
+ source_dir = 'bootstrap' if options[:bootstrap]
+ source_file = [ source_dir, "#{action}.html.erb"].compact.join('/')
+ copy_file source_file, "lib/templates/erb/scaffold/#{action}.html.erb"
end
end
end
|
Copy bootstrap templates if option specified.
|
diff --git a/spec/eee_spec.rb b/spec/eee_spec.rb
index abc1234..def5678 100644
--- a/spec/eee_spec.rb
+++ b/spec/eee_spec.rb
@@ -25,6 +25,5 @@ it "should include a title" do
get "/recipes/#{@permalink}"
response.should be_ok
- response.should have_selector("h1", :content => @title)
end
end
|
Move the view-specific spec into a real view spec.
|
diff --git a/test/pushbullet_test.rb b/test/pushbullet_test.rb
index abc1234..def5678 100644
--- a/test/pushbullet_test.rb
+++ b/test/pushbullet_test.rb
@@ -0,0 +1,75 @@+require File.expand_path('../helper', __FILE__)
+
+class PushbulletTest < Service::TestCase
+ def setup
+ @stubs = Faraday::Adapter::Test::Stubs.new
+
+ @options = {"api_key" => "a", "device_iden" => "hi"}
+ end
+
+ def test_push
+ @stubs.post "/api/pushes" do |env|
+ check_env env
+
+ expected = {
+ "device_iden"=>"hi",
+ "type"=>"note",
+ "title"=>"rtomayko pushed 3 commits",
+ "body"=>"Repo: mojombo/grit\nLatest: add more comments throughout" }
+
+ assert_equal expected, Faraday::Utils.parse_query(env[:body])
+
+ [200, {}, '']
+ end
+
+ service(:push, @options, payload).receive_push
+ end
+
+ def test_issue
+ @stubs.post "/api/pushes" do |env|
+ check_env env
+
+ expected = {
+ "device_iden"=>"hi",
+ "type"=>"note",
+ "title"=>"mojombo opened issue #5",
+ "body"=>"Repo: mojombo/grit\nIssue: \"booya\"\nboom town"
+ }
+
+ assert_equal expected, Faraday::Utils.parse_query(env[:body])
+
+ [200, {}, '']
+ end
+
+ service(:issue, @options, issues_payload).receive_issue
+ end
+
+ def test_pull_request
+ @stubs.post "/api/pushes" do |env|
+ check_env env
+
+ expected = {
+ "device_iden"=>"hi",
+ "type"=>"note",
+ "title"=>"foo opened pull request #5",
+ "body"=>"Repo: mojombo/grit\nPull Request: \"booya\"\nboom town"
+ }
+
+ assert_equal expected, Faraday::Utils.parse_query(env[:body])
+
+ [200, {}, '']
+ end
+
+ service(:pull_request, @options, pull_payload).receive_pull_request
+ end
+
+ def check_env(env)
+ assert_equal 'https', env[:url].scheme
+ assert_equal "api.pushbullet.com", env[:url].host
+ assert_equal "Basic YTo=", env[:request_headers]["Authorization"]
+ end
+
+ def service(*args)
+ super(Service::Pushbullet, *args)
+ end
+end
|
Add test for Pushbullet service.
|
diff --git a/test/test_hierogloss.rb b/test/test_hierogloss.rb
index abc1234..def5678 100644
--- a/test/test_hierogloss.rb
+++ b/test/test_hierogloss.rb
@@ -4,8 +4,4 @@ def test_that_it_has_a_version_number
refute_nil ::Hierogloss::VERSION
end
-
- def test_it_does_something_useful
- assert false
- end
end
|
Remove auto-generated failing unit test
|
diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb
index abc1234..def5678 100644
--- a/spec/controllers/request_controller_spec.rb
+++ b/spec/controllers/request_controller_spec.rb
@@ -0,0 +1,28 @@+require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
+
+describe RequestController do
+
+ describe 'GET get_attachment' do
+
+ it "returns RecordNotFound if the message body contains the
+ requester's details" do
+ user = FactoryGirl.create(:user, :dob => '2/2/2000')
+ info_request = FactoryGirl.create(:info_request, :user => user)
+ incoming_message = FactoryGirl.create(:incoming_message_with_html_attachment,
+ :info_request => info_request)
+
+ incoming_message.foi_attachments.each do |a|
+ a.body = "Your name and address: Some name"
+ a.save!
+ end
+
+ expect{ get :get_attachment, :incoming_message_id => incoming_message.id,
+ :id => info_request.id,
+ :part => 2,
+ :file_name => 'interesting.html',
+ :skip_cache => 1 }.to raise_error(ActiveRecord::RecordNotFound)
+ end
+
+ end
+
+end
|
Add spec for hiding of attachments that show personal details.
|
diff --git a/spec/generators/uninstall_generator_spec.rb b/spec/generators/uninstall_generator_spec.rb
index abc1234..def5678 100644
--- a/spec/generators/uninstall_generator_spec.rb
+++ b/spec/generators/uninstall_generator_spec.rb
@@ -22,7 +22,7 @@
it "creates migrations for droping histories table" do
- assert_migration 'db/migrate/drop_rails_admin_histories.rb'
+ assert_migration 'db/migrate/drop_rails_admin_histories_table.rb'
end
it "removes config file" do
|
Add _table-suffix to migration filename in uninstall spec
|
diff --git a/Casks/cloudfoundry-cli.rb b/Casks/cloudfoundry-cli.rb
index abc1234..def5678 100644
--- a/Casks/cloudfoundry-cli.rb
+++ b/Casks/cloudfoundry-cli.rb
@@ -1,6 +1,6 @@ cask :v1 => 'cloudfoundry-cli' do
- version '6.6.1'
- sha256 '1a159944a447b4b321513cadd8c009477dc084ce22b6bfd2e5e20382d98bb5e5'
+ version '6.7.0'
+ sha256 '72eece2bf48473313bf57458429828cc65d195600381810d176d633f79388d69'
url "http://go-cli.s3-website-us-east-1.amazonaws.com/releases/v#{version}/installer-osx-amd64.pkg"
homepage 'https://github.com/cloudfoundry/cli'
|
Upgrade Cloud Foundry CLI to 6.7.0
|
diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb
index abc1234..def5678 100644
--- a/config/initializers/sidekiq.rb
+++ b/config/initializers/sidekiq.rb
@@ -6,14 +6,19 @@ end
end
+redis_options = { url: REDIS_URL, namespace: 'sidekiq' }
+
+# Set Redis driver explicitly if FakeRedis is used
+redis_options.merge!(driver: Redis::Connection::Memory) if defined?(Redis::Connection::Memory)
+
Sidekiq.configure_server do |config|
- config.redis = { url: REDIS_URL, namespace: 'sidekiq' }
+ config.redis = redis_options
config.poll_interval = 1
- config.error_handlers << -> (exception, context) { Airbrake.notify_or_ignore(exception, parameters: context) }
+ config.error_handlers << ->(exception, context) { Airbrake.notify_or_ignore(exception, parameters: context) }
end
Sidekiq.configure_client do |config|
- config.redis = { url: REDIS_URL, namespace: 'sidekiq', size: 1 }
+ config.redis = redis_options.merge(size: 1)
end
Sidekiq.default_worker_options = {
|
Use FakeRedis in Sidekiq as well
|
diff --git a/app/controllers/hologram_rails/styleguide_controller.rb b/app/controllers/hologram_rails/styleguide_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/hologram_rails/styleguide_controller.rb
+++ b/app/controllers/hologram_rails/styleguide_controller.rb
@@ -3,6 +3,5 @@ module HologramRails
class StyleguideController < ApplicationController
include HighVoltage::StaticPage
- layout "hologram_rails"
end
end
|
Use default application layout for styleguide
|
diff --git a/app/models/course/assessment/question/forum_response.rb b/app/models/course/assessment/question/forum_response.rb
index abc1234..def5678 100644
--- a/app/models/course/assessment/question/forum_response.rb
+++ b/app/models/course/assessment/question/forum_response.rb
@@ -2,14 +2,20 @@ class Course::Assessment::Question::ForumResponse < ApplicationRecord
acts_as :question, class_name: Course::Assessment::Question.name
- validates :has_text_response, presence: true
- validates :max_posts, presence: true, numericality: { only_integer: true }, in: (1..max_posts_allowed).to_a
+ validates :max_posts, presence: true, numericality: { only_integer: true }
+ validate :allowable_max_post_count
def question_type
I18n.t('course.assessment.question.forum_responses.question_type')
end
- def self.max_posts_allowed
+ def max_posts_allowed
10
end
+
+ def allowable_max_post_count
+ unless (1..max_posts_allowed).include?(max_posts)
+ errors.add(:max_posts, "has to be between 1 and #{max_posts_allowed}")
+ end
+ end
end
|
fix(ForumResponse): Set max no of posts that could be selected
|
diff --git a/app/serializers/show_annual_report_upload_serializer.rb b/app/serializers/show_annual_report_upload_serializer.rb
index abc1234..def5678 100644
--- a/app/serializers/show_annual_report_upload_serializer.rb
+++ b/app/serializers/show_annual_report_upload_serializer.rb
@@ -0,0 +1,68 @@+class ShowAnnualReportUploadSerializer < ActiveModel::Serializer
+ attributes :id, :trading_country_id, :point_of_view, :number_of_rows,
+ :file_name, :has_primary_errors, :created_at, :updated_at,
+ :created_by, :updated_by, :summary,
+ :validation_errors, :ignored_validation_errors
+
+ def validation_errors
+ object.validation_errors.reject do |ve|
+ ve.is_ignored
+ end.sort_by(&:error_message)
+ end
+
+ def ignored_validation_errors
+ object.validation_errors.select do |ve|
+ ve.is_ignored
+ end.sort_by(&:error_message)
+ end
+
+ def file_name
+ object.csv_source_file.try(:path) && File.basename(object.csv_source_file.path)
+ end
+
+ def has_primary_errors
+ !validation_errors.index { |ve| ve.is_primary }.nil?
+ end
+
+ def created_at
+ if object.epix_created_at
+ object.epix_created_at.strftime("%d/%m/%y")
+ elsif object.created_at
+ object.created_at.strftime("%d/%m/%y")
+ else
+ nil
+ end
+ end
+
+ def updated_at
+ object.updated_at.strftime("%d/%m/%y")
+ end
+
+ def created_by
+ if object.epix_creator
+ object.epix_creator.name
+ elsif object.sapi_creator
+ object.sapi_creator.name
+ else
+ nil
+ end
+ end
+
+ def updated_by
+ if object.epix_updater
+ object.epix_updater.name
+ elsif object.sapi_updater
+ object.sapi_updater.name
+ else
+ nil
+ end
+ end
+
+ def summary
+ _created_at = (object.epix_created_at || object.created_at).strftime("%d/%m/%y")
+ _created_by = (object.epix_creator || object.sapi_creator).name
+ object.trading_country.name_en + ' (' + object.point_of_view + '), ' +
+ object.number_of_rows.to_s + ' shipments' + ' uploaded on ' + _created_at +
+ ' by ' + _created_by + ' (' + (file_name || '') + ')'
+ end
+end
|
Add serializer for show page of aru
|
diff --git a/spec/page_objects/circle/roles.rb b/spec/page_objects/circle/roles.rb
index abc1234..def5678 100644
--- a/spec/page_objects/circle/roles.rb
+++ b/spec/page_objects/circle/roles.rb
@@ -9,13 +9,15 @@ sections :admins, '.default-table tbody tr' do
element :role, 'td:nth-child(1)'
element :name, 'td:nth-child(2)'
+ element :status, 'td:nth-child(3)'
element :remove_button, 'a.delete'
end
def has_admin?(admin_to_find)
admins.any? do |admin|
admin.name.text == admin_to_find.name &&
- admin.role.text == 'Admin'
+ admin.role.text == 'Admin' &&
+ admin.status.text == 'Active'
end
end
|
Verify new admin role is active.
|
diff --git a/spec/unit/sql/fuzzer/each_spec.rb b/spec/unit/sql/fuzzer/each_spec.rb
index abc1234..def5678 100644
--- a/spec/unit/sql/fuzzer/each_spec.rb
+++ b/spec/unit/sql/fuzzer/each_spec.rb
@@ -3,8 +3,8 @@ require 'spec_helper'
describe SQL::Fuzzer, '#each' do
- let(:object) { described_class.new(ast) }
- let(:ast) { stub('ast').as_null_object }
+ let(:object) { described_class.new(ast) }
+ let(:ast) { double('ast').as_null_object }
before do
ast.should_receive(:to_ast)
|
Replace deprecated stub method with double in specs
|
diff --git a/BLCStarRatingView.podspec b/BLCStarRatingView.podspec
index abc1234..def5678 100644
--- a/BLCStarRatingView.podspec
+++ b/BLCStarRatingView.podspec
@@ -9,14 +9,14 @@
Pod::Spec.new do |s|
s.name = "BLCStarRatingView"
- s.version = "1.0.0"
+ s.version = "1.1.0"
s.summary = "A star rating view for iOS"
s.homepage = "https://github.com/lucabartoletti/BLCStarRatingView"
s.screenshots = "https://raw.githubusercontent.com/lucabartoletti/BLCStarRatingView/master/README/screenshot.png"
s.license = 'MIT'
s.author = { "Luca Bartoletti" => "luca.bartoletti@gmail.com" }
- s.source = { :git => "https://github.com/lucabartoletti/BLCStarRatingView.git", :tag => "1.0.0" }
+ s.source = { :git => "https://github.com/lucabartoletti/BLCStarRatingView.git", :tag => "1.1.0" }
s.social_media_url = 'https://twitter.com/lucabartoletti'
s.platform = :ios, '6.0'
|
Update podspect to support version 1.1.0
|
diff --git a/actionpack/lib/action_view/template_handlers/compilable.rb b/actionpack/lib/action_view/template_handlers/compilable.rb
index abc1234..def5678 100644
--- a/actionpack/lib/action_view/template_handlers/compilable.rb
+++ b/actionpack/lib/action_view/template_handlers/compilable.rb
@@ -16,36 +16,6 @@ @view.send(:execute, template, local_assigns)
end
- # Compile and evaluate the template's code
- def compile_template(template)
- return false unless recompile_template?(template)
-
- @@mutex.synchronize do
- locals_code = template.locals.keys.map { |key| "#{key} = local_assigns[:#{key}];" }.join
-
- source = <<-end_src
- def #{template.method}(local_assigns)
- old_output_buffer = output_buffer;#{locals_code};#{compile(template)}
- ensure
- self.output_buffer = old_output_buffer
- end
- end_src
-
- begin
- file_name = template.filename || 'compiled-template'
- ActionView::Base::CompiledTemplates.module_eval(source, file_name, 0)
- rescue Exception => e # errors from template code
- if logger = ActionController::Base.logger
- logger.debug "ERROR: compiling #{template.method} RAISED #{e}"
- logger.debug "Function body: #{source}"
- logger.debug "Backtrace: #{e.backtrace.join("\n")}"
- end
-
- raise ActionView::TemplateError.new(template, @view.assigns, e)
- end
- end
- end
-
private
# Method to check whether template compilation is necessary.
# The template will be compiled if the inline template or file has not been compiled yet,
|
Remove dead code from merge
|
diff --git a/boot/fancy_ext/block_env.rb b/boot/fancy_ext/block_env.rb
index abc1234..def5678 100644
--- a/boot/fancy_ext/block_env.rb
+++ b/boot/fancy_ext/block_env.rb
@@ -12,16 +12,16 @@ alias_method :":call", :call
define_method("call:") do |args|
- if args.size < self.arity
- raise ArgumentError, "Too few arguments for block: #{args.size} - Minimum of #{self.arity} expected"
- else
+ # if args.size < self.arity
+ # raise ArgumentError, "Too few arguments for block: #{args.size} - Minimum of #{self.arity} expected"
+ # else
if args.first.is_a?(Array) && args.size == 1
call args.first
else
args = args.first(self.arity) if args.size > self.arity
call *args
end
- end
+ # end
end
define_method("call_with_receiver:") do |obj|
|
Undo check for unsufficient argument count for now (causes problems during bootstrap).
|
diff --git a/syntax.gemspec b/syntax.gemspec
index abc1234..def5678 100644
--- a/syntax.gemspec
+++ b/syntax.gemspec
@@ -11,5 +11,6 @@
s.add_development_dependency "rake"
s.add_development_dependency "rake-contrib"
+ s.add_development_dependency "rdoc"
s.add_development_dependency "test-unit"
end
|
Include rdoc as a dev dependency.
|
diff --git a/Casks/handbrakecli-nightly.rb b/Casks/handbrakecli-nightly.rb
index abc1234..def5678 100644
--- a/Casks/handbrakecli-nightly.rb
+++ b/Casks/handbrakecli-nightly.rb
@@ -1,6 +1,6 @@ cask :v1 => 'handbrakecli-nightly' do
- version '7031svn'
- sha256 '29584bd078000dc79c95c56aa9483e7bc5d6cce048349414e4016bcea68ef76d'
+ version '7073svn'
+ sha256 '50a374f8b8984735e8f2b49d5be78f2dc713d433e3982ce539697c31fea190de'
url "http://download.handbrake.fr/nightly/HandBrake-#{version}-MacOSX.6_CLI_x86_64.dmg"
homepage 'http://handbrake.fr'
|
Update HandbrakeCLI Nightly to v7073svn
HandBrakeCLI Nightly v7073svn built 2015-04-09.
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -57,11 +57,11 @@ resources :ui_associations, path: 'ui-associations', only: [:new]
resources :slides, only: [:new]
- # unauthenticated do
- # as :user do
- # root to: 'users/sessions#new'
- # end
- # end
+ unauthenticated do
+ as :user do
+ root to: 'users/sessions#new'
+ end
+ end
root to: "dashboard#show"
end
|
Add unauthenticated route back for Rails3
|
diff --git a/lib/country_select/rails3/country_select_helper.rb b/lib/country_select/rails3/country_select_helper.rb
index abc1234..def5678 100644
--- a/lib/country_select/rails3/country_select_helper.rb
+++ b/lib/country_select/rails3/country_select_helper.rb
@@ -1,7 +1,14 @@ module ActionView
module Helpers
class FormBuilder
- def country_select(method, options = {}, html_options = {})
+ def country_select(method, priority_or_options = {}, options = {}, html_options = {})
+ if Hash === priority_or_options
+ html_options = options
+ options = priority_or_options
+ else
+ options[:priority_countries] = priority_or_options
+ end
+
@template.country_select(@object_name, method, objectify_options(options), @default_options.merge(html_options))
end
end
|
Add fixes for Rails 3
|
diff --git a/lib/xclarity_client/discover_request_management.rb b/lib/xclarity_client/discover_request_management.rb
index abc1234..def5678 100644
--- a/lib/xclarity_client/discover_request_management.rb
+++ b/lib/xclarity_client/discover_request_management.rb
@@ -10,7 +10,7 @@ end
def discover_manageable_devices(ip_addresses)
- postReq = JSON.generate(["ipAddresses":ip_addresses])
+ postReq = JSON.generate([ipAddresses: ip_addresses])
response = do_post(DiscoverRequest::BASE_URI, postReq)
response
end
|
Change the format of JSON representation
|
diff --git a/test/state_transition/test_state_transition_on_transition_callback.rb b/test/state_transition/test_state_transition_on_transition_callback.rb
index abc1234..def5678 100644
--- a/test/state_transition/test_state_transition_on_transition_callback.rb
+++ b/test/state_transition/test_state_transition_on_transition_callback.rb
@@ -1,7 +1,12 @@ require 'helper'
-class Car
+class Truck
include Transitions
+ attr_reader :test_recorder
+
+ def initialize
+ @test_recorder = []
+ end
state_machine do
state :parked
@@ -18,26 +23,26 @@ end
%w!start_engine loosen_handbrake push_gas_pedal!.each do |m|
- define_method(m){}
+ define_method(m){ @test_recorder << m }
end
end
class TestStateTransitionCallbacks < Test::Unit::TestCase
- def setup
- @car = Car.new
- end
-
test "should execute callback defined via 'on_transition'" do
- @car.expects(:start_engine)
- @car.turn_key!
+ truck = Truck.new
+ truck.expects(:start_engine)
+ truck.turn_key!
end
test "should execute multiple callbacks defined via 'on_transition' in the same order they were defined" do
- on_transition_sequence = sequence('on_transition_sequence')
+ # This test requires some explanation: We started out with something like this:
+ # truck.expects(:start_engine).in_sequence(on_transition_sequence)
+ # Which, after a while (don't ask me why) caused some weird problems and seemed to fail randomly.
+ # Hence the workaround below.
- @car.expects(:start_engine).in_sequence(on_transition_sequence)
- @car.expects(:loosen_handbrake).in_sequence(on_transition_sequence)
- @car.expects(:push_gas_pedal).in_sequence(on_transition_sequence)
- @car.start_driving!
+ truck = Truck.new
+
+ truck.start_driving!
+ assert_equal truck.test_recorder, [:start_engine, :loosen_handbrake, :push_gas_pedal].map(&:to_s)
end
end
|
Fix weird and more or less random test failure.
|
diff --git a/spec/client/partial_message_spec.rb b/spec/client/partial_message_spec.rb
index abc1234..def5678 100644
--- a/spec/client/partial_message_spec.rb
+++ b/spec/client/partial_message_spec.rb
@@ -13,28 +13,28 @@ it 'should not hold stale message data across a reconnect' do
got_message = false
expect do
- EM.run do
- timeout_em_on_failure(2)
- timeout_nats_on_failure(2)
-
+ with_em_timeout(5) do |future|
+ # First client connects, and will attempt to reconnects
c1 = NATS.connect(:uri => @s.uri, :reconnect_time_wait => 0.25)
wait_on_connections([c1]) do
c1.subscribe('subject') do |msg|
got_message = true
- msg.should eq('complete message')
- EM.stop
- NATS.stop
+ expect(msg).to eql('complete message')
+ future.resume
end
- # Client receives partial message before server terminates
+ # Client receives partial message before server terminates.
c1.receive_data("MSG subject 2 32\r\nincomplete")
+ # Server restarts, disconnecting the first client.
@s.kill_server
@s.start_server
+ # One more client connects and publishes a message.
NATS.connect(:uri => @s.uri) do |c2|
- EM.add_timer(0.25) do
- c1.connected_server.should == @s.uri
+ EM.add_timer(0.50) do
+ expect(c1.connected_server).to eql(@s.uri)
+ expect(c2.connected_server).to eql(@s.uri)
c1.flush { c2.publish('subject', 'complete message') }
end
end
@@ -42,6 +42,6 @@ end
end.to_not raise_exception
- got_message.should be_truthy
+ expect(got_message).to eql(true)
end
end
|
Update spec for partial message which was flapping
|
diff --git a/spec/factories/booking_templates.rb b/spec/factories/booking_templates.rb
index abc1234..def5678 100644
--- a/spec/factories/booking_templates.rb
+++ b/spec/factories/booking_templates.rb
@@ -1,18 +1,19 @@-Factory.define :booking_template do |b|
+FactoryGirl.define do
+ factory :booking_template do
+ factory :cash do
+ title 'Bareinnahmen'
+ association :credit_account, :factory => :cash_account
+ association :debit_account, :factory => :service_account
+ code 'day:cash'
+ matcher '[B|b]arein[z|Z]ahlung'
+ end
+
+ factory :card_turnover do
+ title 'Kreditkarten Einnahmen'
+ association :credit_account, :factory => :eft_account
+ association :debit_account, :factory => :service_account
+ code 'day:card turnover'
+ matcher 'test'
+ end
+ end
end
-
-Factory.define :cash, :parent => :booking_template do |b|
- b.title 'Bareinnahmen'
- b.association :credit_account, :factory => :cash_account
- b.association :debit_account, :factory => :service_account
- b.code 'day:cash'
- b.matcher '[B|b]arein[z|Z]ahlung'
-end
-
-Factory.define :card_turnover, :parent => :booking_template do |b|
- b.title 'Kreditkarten Einnahmen'
- b.association :credit_account, :factory => :eft_account
- b.association :debit_account, :factory => :service_account
- b.code 'day:card turnover'
- b.matcher 'test'
-end
|
Use modern syntax for booking template factory.
|
diff --git a/spec/integration/repository_spec.rb b/spec/integration/repository_spec.rb
index abc1234..def5678 100644
--- a/spec/integration/repository_spec.rb
+++ b/spec/integration/repository_spec.rb
@@ -5,10 +5,6 @@
RSpec.describe 'Tweets Repository', integration: true do
subject(:repository) { Plaintweet::Repository.new }
-
- before do
- WebMock.allow_net_connect!
- end
it 'provides the tweet' do
tweet = repository.tweet('https://twitter.com/dcxxx187/status/891545131417030656')
|
Allow network connection for integration tests
|
diff --git a/spec/models/user_identifier_spec.rb b/spec/models/user_identifier_spec.rb
index abc1234..def5678 100644
--- a/spec/models/user_identifier_spec.rb
+++ b/spec/models/user_identifier_spec.rb
@@ -3,16 +3,13 @@ RSpec.describe UserIdentifier, type: :model do
context "validations" do
+
it { is_expected.to validate_presence_of(:identifier) }
+
it { is_expected.to validate_presence_of(:user) }
- it "validates uniqueness of identifier_scheme_id" do
- subject.identifier_scheme = create(:identifier_scheme)
- expect(subject).to validate_uniqueness_of(:identifier_scheme_id)
- .case_insensitive
- .scoped_to(:user_id)
- .with_message("must be unique")
- end
+
it { is_expected.to validate_presence_of(:identifier_scheme) }
+
end
context "associations" do
|
Remove validation spec for UserIdentifier spec
This validation was removed from the model
|
diff --git a/lib/cognizant/system/process.rb b/lib/cognizant/system/process.rb
index abc1234..def5678 100644
--- a/lib/cognizant/system/process.rb
+++ b/lib/cognizant/system/process.rb
@@ -23,8 +23,8 @@ end
def self.send_signals(pid, options = {})
- # Return if the process is already stopped.
- return true unless pid_running?
+ # Return if the process is not running.
+ return true unless self.pid_running?(pid)
signals = options[:signals] || ["TERM", "INT", "KILL"]
timeout = options[:timeout] || 10
|
Fix the pid running check method call.
|
diff --git a/lib/ethon/easy/http/postable.rb b/lib/ethon/easy/http/postable.rb
index abc1234..def5678 100644
--- a/lib/ethon/easy/http/postable.rb
+++ b/lib/ethon/easy/http/postable.rb
@@ -4,6 +4,7 @@
# This module contains logic for setting up a [multipart] POST body.
module Postable
+
# Set things up when form is provided.
# Deals with multipart forms.
#
@@ -20,7 +21,7 @@ else
form.escape = true
easy.copypostfields = form.to_s
- easy.postfieldsize = easy.copypostfields.bytesize
+ easy.postfieldsize = form.to_s.bytesize
end
end
end
|
Use form to get size.
|
diff --git a/test/ts_all.rb b/test/ts_all.rb
index abc1234..def5678 100644
--- a/test/ts_all.rb
+++ b/test/ts_all.rb
@@ -30,6 +30,14 @@ require 'test/adapter/redland/test_redland_adapter'
require 'test/adapter/redland/test_redland_adapter_add'
require 'test/adapter/redland/test_redland_adapter_remove'
+require 'test/adapter/redland/test_redland_basic_query'
+require 'test/adapter/redland/test_redland_joint_query'
+
+require 'test/adapter/yars/test_yars_adapter'
+require 'test/adapter/yars/test_yars_adapter_add'
+require 'test/adapter/yars/test_yars_adapter_remove'
+require 'test/adapter/yars/test_yars_basic_query'
+require 'test/adapter/yars/test_yars_joint_query'
require 'test/resource/test_resource_get'
require 'test/resource/test_resource'
|
Add unit test for adapter.
|
diff --git a/cmd/brew-test-bot-docker.rb b/cmd/brew-test-bot-docker.rb
index abc1234..def5678 100644
--- a/cmd/brew-test-bot-docker.rb
+++ b/cmd/brew-test-bot-docker.rb
@@ -17,7 +17,7 @@ "linuxbrew/linuxbrew",
"sh", "-c", <<-EOS.undent
sudo apt-get install -y python
- brew tap linuxbrew/homebrew-org
+ brew tap linuxbrew/xorg
mkdir linuxbrew-test-bot
cd linuxbrew-test-bot
brew test-bot #{argv}
|
test-bot-docker: Fix a typo (tap linuxbrew/xorg)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.