spec/support/shared_examples/controller_examples.rb in neutral-0.0.7 vs spec/support/shared_examples/controller_examples.rb in neutral-0.0.8
- old
+ new
@@ -34,10 +34,12 @@
end
end
shared_examples "not performing destroy" do
it "does not destroy the vote" do
- expect { destroy(vote) }.to_not change(Neutral::Vote, :count).by(-1)
+ initial_count = Neutral::Vote.count
+ destroy(vote)
+ expect(Neutral::Vote.count).to eq(initial_count)
end
it "renders cannot_change template" do
expect(destroy(vote)).to render_template('errors/cannot_change')
end