thirteen-tien-len/spec/models/play_to_beat_spec.rb
2022-05-20 23:12:55 -07:00

33 lines
870 B
Ruby

require 'rails_helper'
RSpec.describe PlayToBeat, :type => :model do
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