Last active
December 27, 2015 09:28
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# было | |
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