summaryrefslogtreecommitdiff
path: root/spec/views/games/index.html.erb_spec.rb
blob: 310739388711eb134693e012c7c0bf79ec67be8d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
require 'spec_helper'

describe "games/index" do
  before(:each) do
    assign(:games, [
      stub_model(Game,
        :name => "MyText",
        :players_per_team => 1,
        :teams_per_match => 2,
        :set_rounds => 3,
        :randomized_teams => 4
      ),
      stub_model(Game,
        :name => "MyText",
        :players_per_team => 1,
        :teams_per_match => 2,
        :set_rounds => 3,
        :randomized_teams => 4
      )
    ])
  end

  it "renders a list of games" do
    render
    # Run the generator again with the --webrat flag if you want to use webrat matchers
    assert_select "tr>td", :text => "MyText".to_s, :count => 2
    assert_select "tr>td", :text => 1.to_s, :count => 2
    assert_select "tr>td", :text => 2.to_s, :count => 2
    assert_select "tr>td", :text => 3.to_s, :count => 2
    assert_select "tr>td", :text => 4.to_s, :count => 2
  end
end