The following is not valid. Because Rspec thinks that it is not really clear what it means (there is actually a special warning if you do that). Do you mean that both should not change? Or only the second, but the first should not?
The better approach is to use the following:
Now the meaning is clear. Both should not change.
To define the matcher, add the following to your test setup (e.g. spec/rails_helper.rb
):