Table must be created before game for test setup
This commit is contained in:
parent
5bdd7217c7
commit
c7f91341f8
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user