Module: RSpec::Rails::Mocks::ActiveRecordInstanceMethods
- Defined in:
- lib/rspec/rails/mocks.rb
Instance Method Summary collapse
Instance Method Details
#[](key) ⇒ Object
33 34 35 |
# File 'lib/rspec/rails/mocks.rb', line 33 def [](key) send(key) end |
#destroy ⇒ Object
28 29 30 31 |
# File 'lib/rspec/rails/mocks.rb', line 28 def destroy self.stub(:persisted?) { false } self.stub(:id) { nil } end |
#new_record? ⇒ Boolean
37 38 39 |
# File 'lib/rspec/rails/mocks.rb', line 37 def new_record? !persisted? end |