Suited run spec

This commit is contained in:
Jesse C. Fisher 2022-05-20 23:12:55 -07:00
parent 5a1bfd33ae
commit f30610722e

View File

@ -1,5 +1,32 @@
require 'rails_helper' require 'rails_helper'
RSpec.describe PlayToBeat, :type => :model do RSpec.describe PlayToBeat, :type => :model do
pending "add some examples to (or delete) #{__FILE__}" before(:each) do
@game = setup_game
@play_to_beat = @game.controlling_player.plays.new(game_id: @game.id)
end
subject { @play_to_beat }
it { should respond_to(:game_id) }
it { should respond_to(:game) }
it { should respond_to(:player_id) }
it { should respond_to(:player) }
it { should respond_to(:player_cards) }
it { should respond_to(:hand) }
it { should respond_to(:hand_type) }
it { should respond_to(:to_s) }
it '#game_id returns a game id' do
expect(@play_to_beat.game).to eq Game.find(@play_to_beat.game_id)
end
describe 'an unsuited run beaten by an suited run' do
it 'remains unsuited' do
# todo create unsuited run
# beat with suited run
expect(@play_to_beat.game).to eq Game.find(@play_to_beat.game_id)
end
end
end end