summaryrefslogtreecommitdiff
path: root/spec/views/games/index.html.erb_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/views/games/index.html.erb_spec.rb')
-rw-r--r--spec/views/games/index.html.erb_spec.rb32
1 files changed, 32 insertions, 0 deletions
diff --git a/spec/views/games/index.html.erb_spec.rb b/spec/views/games/index.html.erb_spec.rb
new file mode 100644
index 0000000..3107393
--- /dev/null
+++ b/spec/views/games/index.html.erb_spec.rb
@@ -0,0 +1,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