diff --git a/spec/models/play_to_beat_spec.rb b/spec/models/play_to_beat_spec.rb index b00d12cc..4fb28eea 100644 --- a/spec/models/play_to_beat_spec.rb +++ b/spec/models/play_to_beat_spec.rb @@ -1,5 +1,32 @@ require 'rails_helper' 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