rspec-rails
https://github.com/rspec/rspec-rails
Ruby
RSpec for Rails 5+
RSpec::Rails::Matchers#be_a_new
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 Use the `with` method to specify the specific attributes to match on the new record.
Edit
git clone [email protected]:rspec/rspec-rails.git
cd rspec-rails
open lib/rspec/rails/matchers/be_a_new.rb
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-RSpec--Rails--Matchers-be_a_new-for-pr
# Commit to gitgit add lib/rspec/rails/matchers/be_a_new.rbgit commit -m "better docs for RSpec::Rails::Matchers#be_a_new"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-RSpec--Rails--Matchers-be_a_new-for-pr
hub pull-request
# Celebrate!