I upgraded rspec version from 2 to 3. This is one of the issues I faced:
Failures: 1) Slide after .destroy(force: false) visible if .with_deleted Failure/Error: expect{@slide.destroy(force: false)}.to_not change(Slide.with_deleted, :count).by(1) NotImplementedError: `expect { }.not_to change { }.by()` is not supported # ./spec/models/slide_spec.rb:36:in `block (3 levels) in <top (required)>'
and in the rspec's changelog I can read it was never supported (oink ?!@#). At the same time there are still some examples how to use change syntax but without not
keyword.
So the question is how to expect no change ?
Fortunately I want to expect no change (any) so I can omit by()
part. It works just fine !
expect{@slide.destroy(force: false)}.to_not change(Slide.with_deleted, :count)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With