Skip to content

Commit

Permalink
Fix all the tests. We should be good to go for 3.1.0.rc1
Browse files Browse the repository at this point in the history
  • Loading branch information
sikachu committed May 25, 2011
1 parent 3170294 commit 71c47f7
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
Expand Up @@ -57,12 +57,12 @@ def sets_the_flash?

def string_value_matches?
return true unless String === @value
flash.values.any? {|value| value == @value }
flash.to_hash.values.any? {|value| value == @value }
end

def regexp_value_matches?
return true unless Regexp === @value
flash.values.any? {|value| value =~ @value }
flash.to_hash.values.any? {|value| value =~ @value }
end

def flash
Expand Down
Expand Up @@ -4,7 +4,7 @@

context "an attribute which must be accepted" do
before do
@model = define_model(:example) do
@model = define_model(:example, :attr => :string) do
validates_acceptance_of :attr
end.new
end
Expand All @@ -30,7 +30,7 @@

context "an attribute which must be accepted with a custom message" do
before do
@model = define_model(:example) do
@model = define_model(:example, :attr => :string) do
validates_acceptance_of :attr, :message => 'custom'
end.new
end
Expand Down
Expand Up @@ -50,7 +50,7 @@
@model = define_model(:example, :attr => :string) do
validates_uniqueness_of :attr, :message => 'Bad value'
end.new
Example.create!
Example.create!(:attr => 'value')
end

it "should fail when checking the default message" do
Expand Down
1 change: 1 addition & 0 deletions spec/support/model_builder.rb
Expand Up @@ -34,6 +34,7 @@ def define_constant(class_name, base, &block)
klass.unloadable

klass.class_eval(&block) if block_given?
klass.reset_column_information if klass.respond_to?(:reset_column_information)

klass
end
Expand Down

0 comments on commit 71c47f7

Please sign in to comment.