Skip to content

Instantly share code, notes, and snippets.

@maslenkov
Last active December 27, 2015 09:28
Show Gist options
  • Save maslenkov/7303611 to your computer and use it in GitHub Desktop.
Save maslenkov/7303611 to your computer and use it in GitHub Desktop.
what way is the best? one spec for block, or few specs for scenario.
# было
context 'add medication' do
before do
create :consult_medication
visit admin_consult_medications_path
within('#sidebar') { click_link 'Add' }
fill_in 'consult_medication[name]', :with => form.name
click_button 'Create'
end
it { should have_content form.name }
it { should have_content 'Medication was successfully created.' }
end
# так лучше?
scenairo 'add medication' do
create :consult_medication
visit admin_consult_medications_path
within('#sidebar') { click_link 'Add' }
fill_in 'consult_medication[name]', :with => form.name
click_button 'Create'
should have_content form.name
should have_content 'Medication was successfully created.'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment