diff --git a/Guardfile b/Guardfile index e08230c..1131585 100644 --- a/Guardfile +++ b/Guardfile @@ -54,10 +54,10 @@ rspec_options = { cmd: "bundle exec spring rspec", all_after_pass: false, failed_mode: :focus, - run_all: { - cmd: "bundle exec parallel_rspec -o '", - cmd_additional_args: "'" - } +# run_all: { +# cmd: "bundle exec parallel_rspec -o '", +# cmd_additional_args: "'" +# } } guard :rspec, rspec_options do #, failed_mode: :focus require "guard/rspec/dsl" diff --git a/app/models/game.rb b/app/models/game.rb index d1a724f..d4079e9 100644 --- a/app/models/game.rb +++ b/app/models/game.rb @@ -166,7 +166,7 @@ class Game < ActiveRecord::Base def over? return false unless self.started? - @inventory_counts = self.players.map {|p| p.player_cards.count > 0 ? player.inventory.count : nil} + @inventory_counts = self.players.map {|p| p.player_cards.count > 0 ? p.inventory.count : nil} @inventory_counts.include? 0 end diff --git a/spec/features/plays_spec.rb b/spec/features/plays_spec.rb index 070f965..c251b28 100644 --- a/spec/features/plays_spec.rb +++ b/spec/features/plays_spec.rb @@ -64,8 +64,7 @@ feature 'Play a hand', type: :feature, js: true do @player_inventory = @player.inventory.join(' ') @card_to_play = @player.inventory.first find_card(@card_to_play).click - #click_button 'Play Hand' - click_button "play_hand_button_#{@player.id}" + click_button 'Play Hand' #wait_for_ajax expect(page).to have_content " " # Played hand is rendered @@ -121,8 +120,7 @@ feature 'Play a hand', type: :feature, js: true do @card_to_play = @player.inventory.first find_card(@card_to_play).click - #click_button 'Play Hand' - click_button "play_hand_button_#{@player.id}" + click_button 'Play Hand' expect(page).to have_content "Hand to beat" expect(cards_to_beat).to eq @card_to_play.to_s expect(page).to have_selector("#player-#{@next_player_id}.has-control") diff --git a/spec/models/play_spec.rb b/spec/models/play_spec.rb index 7b779e6..e5058ac 100644 --- a/spec/models/play_spec.rb +++ b/spec/models/play_spec.rb @@ -445,7 +445,7 @@ RSpec.describe Play, type: :model do @cards_to_play = create_hand(i, 'double run') @play.player_cards << @cards_to_play expect(@play.hand_type).to eq("double run of #{i}") - expect(@play.errors[:player_cards]).to eq([]) + expect(@play.errors[:player_cards]).to be_empty end end end