Bugfix spec test
This commit is contained in:
parent
8b4ac49144
commit
9e7c901551
@ -25,11 +25,11 @@ RSpec.describe Play, type: :model do
|
||||
|
||||
end
|
||||
it '#player_cards returns a PlayerCard collection' do
|
||||
expect(@play.player_cards.class).to eq(PlayerCard::ActiveRecord_Associations_CollectionProxy)
|
||||
expect(@play.player_cards.class.to_s).to eq("PlayerCard::ActiveRecord_Associations_CollectionProxy")
|
||||
end
|
||||
|
||||
it '#hand returns a PlayerCard collection' do
|
||||
expect(@play.hand.class).to eq(PlayerCard::ActiveRecord_Associations_CollectionProxy)
|
||||
expect(@play.hand.class.to_s).to eq("PlayerCard::ActiveRecord_Associations_CollectionProxy")
|
||||
end
|
||||
|
||||
it '#hand_type returns a string' do
|
||||
@ -363,14 +363,14 @@ RSpec.describe Play, type: :model do
|
||||
@diamond3 = PlayerCard.new(rank: "3", suit: "Diamond", value: 3)
|
||||
@heart3 = PlayerCard.new(rank: "3", suit: "Heart", value: 4)
|
||||
@cards_to_play = [@spade3, @club3, @diamond3, @heart3]
|
||||
@play = Play.new(game_id: @game.id, player_id: @game.controlling_player_id, player_cards: @cards_to_beat)
|
||||
@play = Play.new(game_id: @game.id, player_id: @game.controlling_player_id, player_cards: @cards_to_play)
|
||||
|
||||
expect(@play.hand_type).to eq('bomb')
|
||||
#TODO: Refactor this test to only test the @play.beats? method
|
||||
#TODO: Move other expectations to another test
|
||||
#TODO: Test every validation of a play
|
||||
#TODO: Refactor @play.valid? method
|
||||
expect(@play.beats? @play_to_beat).to eq(false)
|
||||
#TODO: Refactor @play.valid? method to account for beats?
|
||||
expect(@play.valid?).to eq(false)
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user