Module Spec::Rails::Mocks::ModelStubber

  1. lib/spec/rails/mocks.rb

Methods

public instance

  1. as_new_record
  2. connection
  3. new_record?

Public instance methods

as_new_record ()
[show source]
# File lib/spec/rails/mocks.rb, line 52
        def as_new_record
          self.id = nil
          self
        end
connection ()
[show source]
# File lib/spec/rails/mocks.rb, line 46
        def connection
          raise Spec::Rails::IllegalDataAccessException.new("stubbed models are not allowed to access the database")
        end
new_record? ()
[show source]
# File lib/spec/rails/mocks.rb, line 49
        def new_record?
          id.nil?
        end