Permalink
Browse files

Explicitly stub valid? in stub_model.

This fixes a bug in stub_model that appeared with the rails-3.2.0.rc2
release, which means that people who use stub_model will have to upgrade
to the next rspec-rails release (2.8.1) when they upgrade to rails-3.2.
  • Loading branch information...
1 parent 0fd5bf4 commit a10c402405b50267bf922f94084eef055502daa9 @dchelimsky dchelimsky committed Jan 5, 2012
Showing with 1 addition and 0 deletions.
  1. +1 −0 lib/rspec/rails/mocks.rb
View
1 lib/rspec/rails/mocks.rb
@@ -93,6 +93,7 @@ def self.primary_key; :id; end
stubs = stubs.reverse_merge(:persisted? => !!stubs[:id],
:destroyed? => false,
:marked_for_destruction? => false,
+ :valid? => true,
:blank? => false)
mock("#{model_class.name}_#{stubs[:id]}", stubs).tap do |m|

0 comments on commit a10c402

Please sign in to comment.