Skip to content
This repository has been archived by the owner on Nov 22, 2017. It is now read-only.

Commit

Permalink
Merge pull request #76 from alphagov/upgrade_rails_to_3.2.13
Browse files Browse the repository at this point in the history
Upgrade rails to 3.2.13
  • Loading branch information
jabley committed Mar 19, 2013
2 parents 77cfab5 + 6ac86a7 commit 7d69870
Show file tree
Hide file tree
Showing 8 changed files with 90 additions and 68 deletions.
8 changes: 5 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
source "https://rubygems.org"
source "https://BnrJb6FZyzspBboNJzYZ@gem.fury.io/govuk/"

gem "rails", "3.2.12"
gem "rails", "3.2.13"

gem "addressable", "2.3.2"
gem "mysql2"
Expand Down Expand Up @@ -49,8 +49,10 @@ group :test do
gem "forgery"
gem "json_expressions"
gem "rspec-rails"
gem "shoulda-matchers"
gem "mocha", require: false
gem "bourne", ">= 1.4.0"
# Use stable version when shoulda-matchers > 1.5.0 gets released
gem "shoulda-matchers", github: "thoughtbot/shoulda-matchers", branch: "dc-bourne-dependency"
gem "mocha", ">= 0.13.3", require: false
gem "simplecov"
gem "simplecov-rcov"
gem "webmock"
Expand Down
109 changes: 57 additions & 52 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,33 +1,42 @@
GIT
remote: git://github.com/thoughtbot/shoulda-matchers.git
revision: d5632b012de4fe23a01231eef2fa6a9aa161d9b7
branch: dc-bourne-dependency
specs:
shoulda-matchers (1.5.0)
activesupport (>= 3.0.0)
bourne (~> 1.3)

GEM
remote: https://rubygems.org/
remote: https://BnrJb6FZyzspBboNJzYZ@gem.fury.io/govuk/
specs:
actionmailer (3.2.12)
actionpack (= 3.2.12)
mail (~> 2.4.4)
actionpack (3.2.12)
activemodel (= 3.2.12)
activesupport (= 3.2.12)
actionmailer (3.2.13)
actionpack (= 3.2.13)
mail (~> 2.5.3)
actionpack (3.2.13)
activemodel (= 3.2.13)
activesupport (= 3.2.13)
builder (~> 3.0.0)
erubis (~> 2.7.0)
journey (~> 1.0.4)
rack (~> 1.4.5)
rack-cache (~> 1.2)
rack-test (~> 0.6.1)
sprockets (~> 2.2.1)
activemodel (3.2.12)
activesupport (= 3.2.12)
activemodel (3.2.13)
activesupport (= 3.2.13)
builder (~> 3.0.0)
activerecord (3.2.12)
activemodel (= 3.2.12)
activesupport (= 3.2.12)
activerecord (3.2.13)
activemodel (= 3.2.13)
activesupport (= 3.2.13)
arel (~> 3.0.2)
tzinfo (~> 0.3.29)
activeresource (3.2.12)
activemodel (= 3.2.12)
activesupport (= 3.2.12)
activesupport (3.2.12)
i18n (~> 0.6)
activeresource (3.2.13)
activemodel (= 3.2.13)
activesupport (= 3.2.13)
activesupport (3.2.13)
i18n (= 0.6.1)
multi_json (~> 1.0)
addressable (2.3.2)
arel (3.0.2)
Expand All @@ -37,8 +46,8 @@ GEM
mime-types
xml-simple
bootstrap-sass (2.1.0.0)
bourne (1.1.2)
mocha (= 0.10.5)
bourne (1.4.0)
mocha (~> 0.13.2)
brakeman (1.7.0)
activesupport
erubis (~> 2.6)
Expand All @@ -64,7 +73,7 @@ GEM
coderay (1.0.7)
crack (0.3.2)
curb (0.8.3)
diff-lcs (1.1.3)
diff-lcs (1.2.1)
erubis (2.7.0)
exception_notification (2.6.1)
actionmailer (>= 3.0.4)
Expand Down Expand Up @@ -92,21 +101,21 @@ GEM
railties (~> 3.0)
thor (~> 0.14)
json (1.7.7)
json_expressions (0.8.1)
json_expressions (0.8.2)
json_pure (1.7.5)
kgio (2.7.4)
libv8 (3.3.10.4)
listen (0.5.0)
mail (2.4.4)
mail (2.5.3)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
metaclass (0.0.1)
method_source (0.8)
mime-types (1.21)
mocha (0.10.5)
mocha (0.13.3)
metaclass (~> 0.0.1)
multi_json (1.5.1)
multi_json (1.7.1)
mysql2 (0.3.11)
net-scp (1.0.4)
net-ssh (>= 1.99.1)
Expand Down Expand Up @@ -138,44 +147,42 @@ GEM
rack
rack-test (0.6.2)
rack (>= 1.0)
rails (3.2.12)
actionmailer (= 3.2.12)
actionpack (= 3.2.12)
activerecord (= 3.2.12)
activeresource (= 3.2.12)
activesupport (= 3.2.12)
rails (3.2.13)
actionmailer (= 3.2.13)
actionpack (= 3.2.13)
activerecord (= 3.2.13)
activeresource (= 3.2.13)
activesupport (= 3.2.13)
bundler (~> 1.0)
railties (= 3.2.12)
railties (3.2.12)
actionpack (= 3.2.12)
activesupport (= 3.2.12)
railties (= 3.2.13)
railties (3.2.13)
actionpack (= 3.2.13)
activesupport (= 3.2.13)
rack-ssl (~> 1.3.2)
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (>= 0.14.6, < 2.0)
raindrops (0.10.0)
rake (10.0.3)
rdoc (3.12.1)
rdoc (3.12.2)
json (~> 1.4)
rest-client (1.6.7)
mime-types (>= 1.16)
router-client (3.0.1)
activesupport
builder
null_logger
rspec (2.11.0)
rspec-core (~> 2.11.0)
rspec-expectations (~> 2.11.0)
rspec-mocks (~> 2.11.0)
rspec-core (2.11.1)
rspec-expectations (2.11.3)
diff-lcs (~> 1.1.3)
rspec-mocks (2.11.2)
rspec-rails (2.11.0)
rspec-core (2.13.1)
rspec-expectations (2.13.0)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.13.0)
rspec-rails (2.13.0)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec (~> 2.11.0)
rspec-core (~> 2.13.0)
rspec-expectations (~> 2.13.0)
rspec-mocks (~> 2.13.0)
ruby2ruby (1.3.1)
ruby_parser (~> 2.0)
sexp_processor (~> 3.0)
Expand All @@ -188,9 +195,6 @@ GEM
tilt (~> 1.3)
sequel (3.39.0)
sexp_processor (3.2.0)
shoulda-matchers (1.4.2)
activesupport (>= 3.0.0)
bourne (~> 1.1.2)
simplecov (0.6.4)
multi_json (~> 1.0)
simplecov-html (~> 0.5.3)
Expand All @@ -207,7 +211,7 @@ GEM
therubyracer (0.10.2)
libv8 (~> 3.3.10)
thor (0.17.0)
tilt (1.3.3)
tilt (1.3.6)
tire (0.4.2)
activemodel (>= 3.0)
hashr (~> 0.0.19)
Expand All @@ -217,7 +221,7 @@ GEM
treetop (1.4.12)
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.35)
tzinfo (0.3.37)
uglifier (1.3.0)
execjs (>= 0.3.0)
multi_json (~> 1.0, >= 1.0.2)
Expand All @@ -242,6 +246,7 @@ DEPENDENCIES
addressable (= 2.3.2)
aws-ses
bootstrap-sass
bourne (>= 1.4.0)
brakeman (= 1.7.0)
builder
capistrano
Expand All @@ -253,21 +258,21 @@ DEPENDENCIES
guard-rspec
jquery-rails (= 1.0.19)
json_expressions
mocha
mocha (>= 0.13.3)
multi_json
mysql2
nokogiri (= 1.5.4)
nulogy-sequel-rails (= 0.3.9)
plek (= 1.0.0)
pry-rails
rabl (= 0.7.6)
rails (= 3.2.12)
rails (= 3.2.13)
railties
router-client (= 3.0.1)
rspec-rails
sass-rails
sequel
shoulda-matchers
shoulda-matchers!
simplecov
simplecov-rcov
therubyracer
Expand Down
4 changes: 2 additions & 2 deletions app/models/measure_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ class MeasureComponent < Sequel::Model
one_to_one :measure, key: :measure_sid,
primary_key: :measure_sid

delegate :description, :abbreviation, to: :duty_expression, prefix: true
delegate :abbreviation, to: :monetary_unit, prefix: true, allow_nil: true
delegate :duty_expression_description, :duty_expression_abbreviation, to: :duty_expression
delegate :monetary_unit_abbreviation, to: :monetary_unit, allow_nil: true
end


2 changes: 1 addition & 1 deletion app/models/measure_condition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class MeasureCondition < Sequel::Model
primary_key: :measure_condition_sid


delegate :abbreviation, to: :monetary_unit, prefix: true, allow_nil: true
delegate :monetary_unit_abbreviation, to: :monetary_unit, allow_nil: true

def before_create
self.measure_condition_sid ||= self.class.next_national_sid
Expand Down
14 changes: 11 additions & 3 deletions spec/models/measure_component_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,17 @@

describe MeasureComponent do
describe 'delegations' do
it { should delegate_method(:duty_expression_description).to(:duty_expression).as(:description) }
it { should delegate_method(:duty_expression_abbreviation).to(:duty_expression).as(:abbreviation) }
it { should delegate_method(:monetary_unit_abbreviation).to(:monetary_unit).as(:abbreviation) }
it 'delegates duty expression description to duty expression' do
expect { MeasureComponent.new.duty_expression_description }.to raise_error RuntimeError
end

it 'delegates duty expression abbreviation to duty expression' do
expect { MeasureComponent.new.duty_expression_abbreviation }.to raise_error RuntimeError
end

it 'delegates monetary unit abbreviation to monetary unit' do
MeasureComponent.new.should respond_to :monetary_unit_abbreviation
end
end

describe 'associations' do
Expand Down
4 changes: 3 additions & 1 deletion spec/models/measure_condition_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
require 'spec_helper'

describe MeasureCondition do
it { should delegate_method(:monetary_unit_abbreviation).to(:monetary_unit).as(:abbreviation) }
it "delegates monetary unit abbreviation to monetary unit" do
MeasureCondition.new.should respond_to :monetary_unit_abbreviation
end

describe 'associations' do
describe 'monetary unit' do
Expand Down
9 changes: 7 additions & 2 deletions spec/models/monetary_unit_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@
let(:monetary_unit) { create :monetary_unit }

describe 'delegations' do
it { should delegate_method(:description).to(:monetary_unit_description) }
it { should delegate_method(:abbreviation).to(:monetary_unit_description) }
it 'delegates description to monetary unit description' do
expect { MonetaryUnit.new.description }.to raise_error RuntimeError
end

it 'delegates abbreviation to monetary unit description' do
expect { MonetaryUnit.new.abbreviation }.to raise_error RuntimeError
end
end

describe '#to_s' do
Expand Down
8 changes: 4 additions & 4 deletions spec/unit/tariff_importer/importers/chief_importer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
describe "#import" do

context "when provided with valid chief file" do
let(:valid_file) { "spec/fixtures/chief_samples/KBT009\(12044\).txt" }

before(:all) do
valid_file = "spec/fixtures/chief_samples/KBT009\(12044\).txt"

@importer = ChiefImporter.new(valid_file)
@importer.import
end
Expand All @@ -33,9 +33,9 @@
end

context "when provided with invalid chief file" do
let(:invalid_file) { "spec/fixtures/chief_samples/invalid_sample.txt" }

before(:all) do
invalid_file = "spec/fixtures/chief_samples/invalid_sample.txt"

@importer = ChiefImporter.new(invalid_file)
rescuing { @importer.import }
end
Expand Down

0 comments on commit 7d69870

Please sign in to comment.