Skip to content

Commit

Permalink
fix spec issue with AR errors class
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean Walbran committed May 2, 2013
1 parent aa38e79 commit 45ec99c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions spec/attr_enumerator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Car
attr_accessor :color
end
end

after(:each) { Object.send(:remove_const, :Car) }

context "validation" do
Expand All @@ -30,14 +30,14 @@ class Car
it "should have a default message" do
Car.attr_enumerator :color, ['red', 'blue']
car.valid?
car.errors.should == {:color => ['is invalid']}
car.errors[:color].should == ['is invalid']
end

it "should allow for a custom message" do
Car.attr_enumerator :color, ['red', 'blue'], :message => '%{value} is not a valid color'
car.color = 'green'
car.valid?
car.errors.should == {:color => ['green is not a valid color']}
car.errors[:color].should == ['green is not a valid color']
end

it "should handle allow_blank" do
Expand Down Expand Up @@ -144,7 +144,7 @@ class Car < ActiveRecord::Base
attr_accessor :color
end
end

after(:each) { Object.send(:remove_const, :Car) }

it "should automatically be included in ActiveRecord::Base" do
Expand Down

0 comments on commit 45ec99c

Please sign in to comment.