Module: RSpec::Rails::Mocks::ActiveModelInstanceMethods
- Defined in:
- lib/rspec/rails/mocks.rb
Instance Method Summary collapse
- #as_new_record ⇒ Object
- #persisted? ⇒ Boolean
- #respond_to?(message, include_private = false) ⇒ Boolean
Instance Method Details
#as_new_record ⇒ Object
9 10 11 12 13 |
# File 'lib/rspec/rails/mocks.rb', line 9 def as_new_record self.stub(:persisted?) { false } self.stub(:id) { nil } self end |
#persisted? ⇒ Boolean
15 16 17 |
# File 'lib/rspec/rails/mocks.rb', line 15 def persisted? true end |
#respond_to?(message, include_private = false) ⇒ Boolean
19 20 21 |
# File 'lib/rspec/rails/mocks.rb', line 19 def respond_to?(, include_private=false) .to_s =~ /_before_type_cast$/ ? false : super end |