Improve semantics
This commit is contained in:
parent
ab12e96879
commit
9bd07aa532
@ -54,10 +54,10 @@ rspec_options = {
|
|||||||
cmd: "bundle exec spring rspec",
|
cmd: "bundle exec spring rspec",
|
||||||
all_after_pass: false,
|
all_after_pass: false,
|
||||||
failed_mode: :focus,
|
failed_mode: :focus,
|
||||||
run_all: {
|
# run_all: {
|
||||||
cmd: "bundle exec parallel_rspec -o '",
|
# cmd: "bundle exec parallel_rspec -o '",
|
||||||
cmd_additional_args: "'"
|
# cmd_additional_args: "'"
|
||||||
}
|
# }
|
||||||
}
|
}
|
||||||
guard :rspec, rspec_options do #, failed_mode: :focus
|
guard :rspec, rspec_options do #, failed_mode: :focus
|
||||||
require "guard/rspec/dsl"
|
require "guard/rspec/dsl"
|
||||||
|
|||||||
@ -166,7 +166,7 @@ class Game < ActiveRecord::Base
|
|||||||
|
|
||||||
def over?
|
def over?
|
||||||
return false unless self.started?
|
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
|
@inventory_counts.include? 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -64,8 +64,7 @@ feature 'Play a hand', type: :feature, js: true do
|
|||||||
@player_inventory = @player.inventory.join(' ')
|
@player_inventory = @player.inventory.join(' ')
|
||||||
@card_to_play = @player.inventory.first
|
@card_to_play = @player.inventory.first
|
||||||
find_card(@card_to_play).click
|
find_card(@card_to_play).click
|
||||||
#click_button 'Play Hand'
|
click_button 'Play Hand'
|
||||||
click_button "play_hand_button_#{@player.id}"
|
|
||||||
#wait_for_ajax
|
#wait_for_ajax
|
||||||
expect(page).to have_content " "
|
expect(page).to have_content " "
|
||||||
# Played hand is rendered
|
# Played hand is rendered
|
||||||
@ -121,8 +120,7 @@ feature 'Play a hand', type: :feature, js: true do
|
|||||||
|
|
||||||
@card_to_play = @player.inventory.first
|
@card_to_play = @player.inventory.first
|
||||||
find_card(@card_to_play).click
|
find_card(@card_to_play).click
|
||||||
#click_button 'Play Hand'
|
click_button 'Play Hand'
|
||||||
click_button "play_hand_button_#{@player.id}"
|
|
||||||
expect(page).to have_content "Hand to beat"
|
expect(page).to have_content "Hand to beat"
|
||||||
expect(cards_to_beat).to eq @card_to_play.to_s
|
expect(cards_to_beat).to eq @card_to_play.to_s
|
||||||
expect(page).to have_selector("#player-#{@next_player_id}.has-control")
|
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')
|
@cards_to_play = create_hand(i, 'double run')
|
||||||
@play.player_cards << @cards_to_play
|
@play.player_cards << @cards_to_play
|
||||||
expect(@play.hand_type).to eq("double run of #{i}")
|
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
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user