diff --git a/spec/features/visitor_plays_spec.rb b/spec/features/visitor_plays_spec.rb index b364454..89e1c6c 100644 --- a/spec/features/visitor_plays_spec.rb +++ b/spec/features/visitor_plays_spec.rb @@ -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 diff --git a/spec/support/helpers/game_helpers.rb b/spec/support/helpers/game_helpers.rb index 662ff0a..f60aab9 100644 --- a/spec/support/helpers/game_helpers.rb +++ b/spec/support/helpers/game_helpers.rb @@ -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