Skip to content

Consistently use record.new_record?. #1803

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 19, 2017

Conversation

myronmarston
Copy link
Member

be_a_new(model_class) and be_new_record were
inconsistent in that one of them checked !persisted?
and one checked new_record?. The docs also said that
both checked !persisted? even only one did.

This changes both to use new_record? and to be documented
as such.

Fixes #1801.

Note that I'm not sure this is the right fix but I figured I'd offer to get the conversation on #1801 rolling. My book has an rspec-rails cheat sheet and documents the current inconsistency which is confusing some readers, so I'd like to get this fixed by publication if possible.

/cc @rspec/rspec

`be_a_new(model_class)` and `be_new_record` were
inconsistent in that one of them checked `!persisted?`
and one checked `new_record?`. The docs also said that
both checked `!persisted?` even only one did.

This changes both to use `new_record?` and to be documented
as such.

Fixes #1801.
@myronmarston myronmarston force-pushed the myron/make-new-record-matchers-consistent branch from aee0bb6 to 1f3836a Compare April 19, 2017 17:11
@fables-tales
Copy link
Member

LGTM

@myronmarston myronmarston merged commit d94443d into master Apr 19, 2017
@myronmarston myronmarston deleted the myron/make-new-record-matchers-consistent branch April 19, 2017 18:44
@JonRowe JonRowe mentioned this pull request Apr 19, 2017
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Matcher inconsistencies
2 participants