Improve semantics
This commit is contained in:
parent
ab12e96879
commit
9bd07aa532
@ -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"
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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")
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user