Test click confirm
This commit is contained in:
parent
7c77ee7688
commit
041f7c6163
@ -42,6 +42,7 @@ feature 'Play now', :devise, js: true do
|
||||
# expect(current_path).to eq table_path(@table)
|
||||
|
||||
#it 'shows the visitor as a player' do
|
||||
@game = Game.last
|
||||
@player = @game.players.last
|
||||
@playerComponent = page.find_all(".seat").first
|
||||
#TODO: have_content @player.display_name
|
||||
|
||||
@ -25,8 +25,10 @@ feature 'Table show', :devise do
|
||||
click_button 'Sit', match: :first
|
||||
expect(page).to have_content "Guest"
|
||||
expect(page.text.scan('Guest').count).to eq 1
|
||||
click_button 'Stand', match: :first
|
||||
expect(page.find('.game-seat.position-1')).to have_content "Sit"
|
||||
accept_confirm do
|
||||
click_button 'Stand', match: :first
|
||||
end
|
||||
expect(page.find('.seat.position-1')).to have_content "Sit"
|
||||
expect(page.text.scan('Guest').count).to eq 0
|
||||
end
|
||||
|
||||
@ -59,8 +61,10 @@ feature 'Table show', :devise do
|
||||
click_button 'Sit', match: :first
|
||||
expect(page).to have_content @user.email
|
||||
expect(page.text.scan(@user.email).count).to eq 1
|
||||
click_button 'Stand', match: :first
|
||||
expect(page.find('.game-seat.position-1')).to have_content "Sit"
|
||||
accept_confirm do
|
||||
click_button 'Stand', match: :first
|
||||
end
|
||||
expect(page.find('.seat.position-1')).to have_content "Sit"
|
||||
expect(page.text.scan(@user.email).count).to eq 0
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user