spec/mongoid/two_spec.rb in money-rails-1.10.0 vs spec/mongoid/two_spec.rb in money-rails-1.11.0

- old
+ new

@@ -1,16 +1,16 @@ require 'spec_helper' if defined?(Mongoid) && ::Mongoid::VERSION =~ /^2(.*)/ describe Money do - let(:priceable) { Priceable.create(:price => Money.new(100, 'EUR')) } - let(:priceable_from_nil) { Priceable.create(:price => nil) } - let(:priceable_from_num) { Priceable.create(:price => 1) } - let(:priceable_from_string) { Priceable.create(:price => '1 EUR' )} - let(:priceable_with_infinite_precision) { Priceable.create(:price => Money.new(BigDecimal.new('100.1'), 'EUR')) } - let(:priceable_from_string_with_hyphen) { Priceable.create(:price => '1-2 EUR' )} + let(:priceable) { Priceable.create(price: Money.new(100, 'EUR')) } + let(:priceable_from_nil) { Priceable.create(price: nil) } + let(:priceable_from_num) { Priceable.create(price: 1) } + let(:priceable_from_string) { Priceable.create(price: '1 EUR' )} + let(:priceable_with_infinite_precision) { Priceable.create(price: Money.new(BigDecimal.new('100.1'), 'EUR')) } + let(:priceable_from_string_with_hyphen) { Priceable.create(price: '1-2 EUR' )} context "serialize" do it "mongoizes correctly nil to nil" do expect(priceable_from_nil.price).to be_nil end @@ -70,10 +70,10 @@ nil_priceable = Priceable.create(price: nil) expect(nil_priceable.price).to be_nil end it 'returns nil if an unknown value was stored' do - zero_priceable = Priceable.create(:price => []) + zero_priceable = Priceable.create(price: []) expect(zero_priceable.price).to be_nil end end end end