Skip to content

Commit

Permalink
Add a team game integration spec.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas Willett committed Jun 8, 2012
1 parent 6aca6dc commit 5b3f046
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions spec/integrations/game_addition_spec.rb
Expand Up @@ -25,3 +25,23 @@
lucas_line.text.strip.should eq '19.00'
end
end

describe 'Entering a team game result' do
let!(:adrian) { User.create! :name => 'Adrian' }
let!(:lucas) { User.create! :name => 'Lucas' }
let!(:nate) { User.create! :name => 'Nate' }
let!(:tate) { User.create! :name => 'Tate' }

before do
visit root_path
fill_in 'result', with: 'Adrian + Lucas beat Nate + Tate 21-14'
select 'Team', from: 'game_type'
click_button 'Record'
end

it 'should add a team game' do
TeamGame.count.should eq 1
TeamGame.first.winner.users.should eq [adrian, lucas]
TeamGame.first.loser.users.should eq [nate, tate]
end
end

0 comments on commit 5b3f046

Please sign in to comment.