From ae03f0720fcb17992c527f330f5f17f0333cab43 Mon Sep 17 00:00:00 2001 From: "Jesse C. Fisher" Date: Fri, 20 May 2022 23:12:55 -0700 Subject: [PATCH] Suited run spec --- spec/models/play_to_beat_spec.rb | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) 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