Replace flash helper with "within"
So we can't forget to find "#flash" on the page ever again...
This commit is contained in:
parent
bc1a21ae46
commit
df0b9ab356
29 changed files with 116 additions and 180 deletions
|
|
@ -22,9 +22,8 @@ feature Room do
|
|||
fill_in 'room_size', with: '100'
|
||||
|
||||
click_button 'Create Room'
|
||||
page.find('#flash')
|
||||
# Validations
|
||||
expect(flash).to eq('Room successfully created.')
|
||||
|
||||
within('#flash') { expect(page).to have_text('Room successfully created.') }
|
||||
within('table#rooms') do
|
||||
expect(page.has_content?('Auditorium')).to be true
|
||||
expect(page.assert_selector('tr', count: 2)).to be true
|
||||
|
|
@ -41,9 +40,8 @@ feature Room do
|
|||
fill_in 'room_size', with: '100'
|
||||
|
||||
click_button 'Update Room'
|
||||
page.find('#flash')
|
||||
# Validations
|
||||
expect(flash).to eq('Room successfully updated.')
|
||||
|
||||
within('#flash') { expect(page).to have_text('Room successfully updated.') }
|
||||
within('table#rooms') do
|
||||
expect(page.has_content?('Auditorium')).to be true
|
||||
expect(page.assert_selector('tr', count: 2)).to be true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue