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