Module: RSpec::Rails::Matchers
- Included in:
- RailsExampleGroup
- Defined in:
- lib/rspec/rails/matchers.rb,
lib/rspec/rails/matchers/be_a_new.rb,
lib/rspec/rails/matchers/redirect_to.rb,
lib/rspec/rails/matchers/be_new_record.rb,
lib/rspec/rails/matchers/have_extension.rb,
lib/rspec/rails/matchers/render_template.rb,
lib/rspec/rails/matchers/routing_matchers.rb
Defined Under Namespace
Modules: HaveExtensions, RedirectTo, RenderTemplate, RoutingMatchers Classes: BeANew, BeANewRecord
Instance Method Summary collapse
-
#be_a_new(model_class) ⇒ Object
Passes if actual is an instance of ‘model_class` and returns `false` for `persisted?`.
-
#be_new_record ⇒ Object
Passes if actual returns ‘false` for `persisted?`.
Instance Method Details
#be_a_new(model_class) ⇒ Object
Passes if actual is an instance of ‘model_class` and returns `false` for `persisted?`. Typically used to specify instance variables assigned to views by controller actions
70 71 72 |
# File 'lib/rspec/rails/matchers/be_a_new.rb', line 70 def be_a_new(model_class) BeANew.new(model_class) end |
#be_new_record ⇒ Object
Passes if actual returns ‘false` for `persisted?`.
17 18 19 |
# File 'lib/rspec/rails/matchers/be_new_record.rb', line 17 def be_new_record BeANewRecord.new end |