Skip to content

Instantly share code, notes, and snippets.

@sergiosouzalima
Last active December 23, 2015 13:14
Show Gist options
  • Save sergiosouzalima/6ff630a55d78a3083e86 to your computer and use it in GitHub Desktop.
Save sergiosouzalima/6ff630a55d78a3083e86 to your computer and use it in GitHub Desktop.
RSpec.describe PagesController, type: :controller do
describe '#destroy' do
context 'when invalid scenario' do
context 'and resource is not found' do
# setup...
let() {...}
let() {...}
let() {...}
subject {}
# exercise....
before do
end
it '...' do
# verify.....
expect(suject).to ....
end
it '...' do
# verify.....
expect(suject).to ....
end
# teardown....
after do
...
end
end
end
context 'when valid scenario' do
context 'and resource is found' do
it '....' do
expect().to ....
end
end
end
end # #destroy
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment