Table must be created before game for test setup

This commit is contained in:
Jesse C. Fisher 2021-11-04 22:56:09 -07:00
parent 97b42e31cb
commit 828a88020e
2 changed files with 6 additions and 8 deletions

View File

@ -7,8 +7,6 @@ feature 'Play a hand', type: :feature, js: true do
@game = setup_visitor_game
visit table_path @game.table
click_button "Sit", match: :first
#TODO: Fix race condition
sleep 2
click_button "Start"
@game.reload
end
@ -18,14 +16,10 @@ feature 'Play a hand', type: :feature, js: true do
end
scenario 'player can see their own 13 card faces' do
#TODO: Fix race condition
sleep 2
expect(page.find_all("#inventory img").length).to eq(13)
end
scenario 'player can see other players 13 card backs' do
#TODO: Remove race condition
sleep 2
inventories = page.find_all(".inventory")
inventories.each do |inventory|
#TODO: This test should verify that other players card fronts are NOT seen

View File

@ -23,8 +23,10 @@ module GameHelpers
end
def setup_visitor_game
table = FactoryGirl.create :table
game = table.current_game
# Default game has 3 players
game = FactoryGirl.create :game
# game = FactoryGirl.create :game
u = FactoryGirl.build :user
game.seats[0].sit u
@ -73,8 +75,10 @@ module Features
end
def setup_visitor_game
table = FactoryGirl.create :table
game = table.current_game
# Default game has 3 players
game = FactoryGirl.create :game
# game = FactoryGirl.create :game
u = FactoryGirl.build :user
game.seats[0].sit u