Skip to content

Commit

Permalink
Added additional tests for errors hash
Browse files Browse the repository at this point in the history
  • Loading branch information
lisahamm committed Feb 26, 2015
1 parent 22bc581 commit 1be04fa
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions spec/game_setup_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,16 @@
invalid_game_setup.valid?
expect(invalid_game_setup.errors.empty?).to eq false
end

it 'stores missing parameter symbol in the errors hash' do
invalid_game_setup.valid?
expect(invalid_game_setup.errors.has_key?(:player_mark)).to eq true
end

it 'stores error messages in error hash for missing parameter' do
invalid_game_setup.valid?
expect(invalid_game_setup.errors[:player_mark].respond_to?(:to_s)).to eq true
end

end
end

0 comments on commit 1be04fa

Please sign in to comment.