Skip to content

Instantly share code, notes, and snippets.

@joshmcarthur
Last active December 19, 2015 19:08
Show Gist options
  • Save joshmcarthur/6003642 to your computer and use it in GitHub Desktop.
Save joshmcarthur/6003642 to your computer and use it in GitHub Desktop.
Testing the effects of a method call
describe "#perform" do
subject { -> { model.perform }.call }
it { expect { subject }.to change(Vehicle, :count).by(1) }
it { expect { subject }.to change(Registration, :count).by(1) }
it { expect { subject }.to change(AuditLog, :count).by(5) }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment