Test click confirm

This commit is contained in:
Jesse C. Fisher 2021-11-05 21:52:58 -07:00
parent 3b7a38d861
commit a72b8271cb
2 changed files with 9 additions and 4 deletions

View File

@ -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

View File

@ -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