Skip to content

Commit

Permalink
Updating the validates_uniqueness_of matcher for Rails 2.1
Browse files Browse the repository at this point in the history
Signed-off-by: Scott Taylor <scott@eastmedia.com>
  • Loading branch information
Tim Glen authored and Scott Taylor committed Jan 23, 2009
1 parent cfda850 commit 57a3be0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/spec/rails/matchers/validations.rb
Expand Up @@ -40,7 +40,7 @@ def validate_length_of(attribute, options)

def validate_uniqueness_of(attribute)
return simple_matcher("model to validate the uniqueness of #{attribute}") do |model|
model.class.stub!(:find).and_return(true)
model.class.stub!(:with_exclusive_scope).and_return([model])
!model.valid? && model.errors.invalid?(attribute)
end
end
Expand Down

0 comments on commit 57a3be0

Please sign in to comment.