Skip to content

Instantly share code, notes, and snippets.

@cupakromer
Last active December 24, 2015 22:09
Show Gist options
  • Save cupakromer/6870815 to your computer and use it in GitHub Desktop.
Save cupakromer/6870815 to your computer and use it in GitHub Desktop.
different ways of skinning tests
describe 'Something Awesome' do
context 'checking on the user' do
context 'given a guest user' do
subject(:guest) { create(:guest_user) }
it 'sees nothing'
end
context 'given an admin user' do
subject(:admin) { create(:admin) }
it 'sees all the things'
end
end
context 'adding an item' do
context 'given a guest user' do
subject(:guest) { create(:guest_user) }
it 'stores it in the cart'
it 'updates the total'
end
context 'given a normal user' do
subject(:shopper) { create(:user) }
it 'stores it in the cart'
it 'updates the total'
end
end
context 'foo awesome sauce' do
context 'given a normal user' do
subject(:shopper) { create(:user) }
it 'dances a jig'
it 'is happy'
end
end
end
describe 'Something Awesome' do
context 'given a guest user' do
subject(:guest) { create(:guest_user) }
context 'checking on the user' do
it 'sees nothing'
end
context 'adding an item' do
it 'stores it in the cart'
it 'updates the total'
end
end
context 'given an admin user' do
subject(:admin) { create(:admin) }
context 'checking on the user' do
it 'sees all the things'
end
end
context 'given a normal user' do
subject(:shopper) { create(:user) }
context 'adding an item' do
it 'stores it in the cart'
it 'updates the total'
end
context 'foo awesome sauce' do
it 'dances a jig'
it 'is happy'
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment