Table must be created before game for test setup
This commit is contained in:
parent
97b42e31cb
commit
828a88020e
@ -7,8 +7,6 @@ feature 'Play a hand', type: :feature, js: true do
|
|||||||
@game = setup_visitor_game
|
@game = setup_visitor_game
|
||||||
visit table_path @game.table
|
visit table_path @game.table
|
||||||
click_button "Sit", match: :first
|
click_button "Sit", match: :first
|
||||||
#TODO: Fix race condition
|
|
||||||
sleep 2
|
|
||||||
click_button "Start"
|
click_button "Start"
|
||||||
@game.reload
|
@game.reload
|
||||||
end
|
end
|
||||||
@ -18,14 +16,10 @@ feature 'Play a hand', type: :feature, js: true do
|
|||||||
end
|
end
|
||||||
|
|
||||||
scenario 'player can see their own 13 card faces' do
|
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)
|
expect(page.find_all("#inventory img").length).to eq(13)
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario 'player can see other players 13 card backs' do
|
scenario 'player can see other players 13 card backs' do
|
||||||
#TODO: Remove race condition
|
|
||||||
sleep 2
|
|
||||||
inventories = page.find_all(".inventory")
|
inventories = page.find_all(".inventory")
|
||||||
inventories.each do |inventory|
|
inventories.each do |inventory|
|
||||||
#TODO: This test should verify that other players card fronts are NOT seen
|
#TODO: This test should verify that other players card fronts are NOT seen
|
||||||
|
|||||||
@ -23,8 +23,10 @@ module GameHelpers
|
|||||||
end
|
end
|
||||||
|
|
||||||
def setup_visitor_game
|
def setup_visitor_game
|
||||||
|
table = FactoryGirl.create :table
|
||||||
|
game = table.current_game
|
||||||
# Default game has 3 players
|
# Default game has 3 players
|
||||||
game = FactoryGirl.create :game
|
# game = FactoryGirl.create :game
|
||||||
|
|
||||||
u = FactoryGirl.build :user
|
u = FactoryGirl.build :user
|
||||||
game.seats[0].sit u
|
game.seats[0].sit u
|
||||||
@ -73,8 +75,10 @@ module Features
|
|||||||
end
|
end
|
||||||
|
|
||||||
def setup_visitor_game
|
def setup_visitor_game
|
||||||
|
table = FactoryGirl.create :table
|
||||||
|
game = table.current_game
|
||||||
# Default game has 3 players
|
# Default game has 3 players
|
||||||
game = FactoryGirl.create :game
|
# game = FactoryGirl.create :game
|
||||||
|
|
||||||
u = FactoryGirl.build :user
|
u = FactoryGirl.build :user
|
||||||
game.seats[0].sit u
|
game.seats[0].sit u
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user