From 45ec99c915f356bf933d01219594468d1749ddbc Mon Sep 17 00:00:00 2001 From: Sean Walbran Date: Thu, 2 May 2013 10:28:10 -0500 Subject: [PATCH] fix spec issue with AR errors class --- spec/attr_enumerator_spec.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/attr_enumerator_spec.rb b/spec/attr_enumerator_spec.rb index 685e4de..96d552c 100644 --- a/spec/attr_enumerator_spec.rb +++ b/spec/attr_enumerator_spec.rb @@ -11,7 +11,7 @@ class Car attr_accessor :color end end - + after(:each) { Object.send(:remove_const, :Car) } context "validation" do @@ -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 @@ -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