Skip to content

Instantly share code, notes, and snippets.

@dennym
Last active August 29, 2015 14:02
Show Gist options
  • Save dennym/39eb93d045416c2dbaca to your computer and use it in GitHub Desktop.
Save dennym/39eb93d045416c2dbaca to your computer and use it in GitHub Desktop.
context 'something went wrong' do
it 'raises an exception and returns 422 Unprocessable Entity' do
@klass = controller.send(:base_class)
allow(@klass).to receive(:recover!).with(@organization.id).and_raise(::Extension::ActiveRecord::Paranoia::RecordNotRestored)
put :restore, format: :json, id: @organization.id
expect(response.status).to eq(422)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment