From fefe3f469243d6c932c256cc8798bae35e4ff1c4 Mon Sep 17 00:00:00 2001 From: AndrewMurrell Date: Sun, 2 Mar 2014 21:10:49 -0500 Subject: Added Tournament Name. --- spec/views/matches/edit.html.erb_spec.rb | 4 +++- spec/views/matches/index.html.erb_spec.rb | 7 +++++-- spec/views/matches/new.html.erb_spec.rb | 4 +++- spec/views/matches/show.html.erb_spec.rb | 4 +++- 4 files changed, 14 insertions(+), 5 deletions(-) (limited to 'spec') diff --git a/spec/views/matches/edit.html.erb_spec.rb b/spec/views/matches/edit.html.erb_spec.rb index 0f7c673..fca468f 100644 --- a/spec/views/matches/edit.html.erb_spec.rb +++ b/spec/views/matches/edit.html.erb_spec.rb @@ -3,7 +3,8 @@ require 'spec_helper' describe "matches/edit" do before(:each) do @match = assign(:match, stub_model(Match, - :tournament => nil + :tournament => nil, + :name => "MyString" )) end @@ -13,6 +14,7 @@ describe "matches/edit" do # Run the generator again with the --webrat flag if you want to use webrat matchers assert_select "form[action=?][method=?]", match_path(@match), "post" do assert_select "input#match_tournament[name=?]", "match[tournament]" + assert_select "input#match_name[name=?]", "match[name]" end end end diff --git a/spec/views/matches/index.html.erb_spec.rb b/spec/views/matches/index.html.erb_spec.rb index e920f16..d3be1b5 100644 --- a/spec/views/matches/index.html.erb_spec.rb +++ b/spec/views/matches/index.html.erb_spec.rb @@ -4,10 +4,12 @@ describe "matches/index" do before(:each) do assign(:matches, [ stub_model(Match, - :tournament => nil + :tournament => nil, + :name => "Name" ), stub_model(Match, - :tournament => nil + :tournament => nil, + :name => "Name" ) ]) end @@ -16,5 +18,6 @@ describe "matches/index" do render # Run the generator again with the --webrat flag if you want to use webrat matchers assert_select "tr>td", :text => nil.to_s, :count => 2 + assert_select "tr>td", :text => "Name".to_s, :count => 2 end end diff --git a/spec/views/matches/new.html.erb_spec.rb b/spec/views/matches/new.html.erb_spec.rb index c3537dc..4423d2c 100644 --- a/spec/views/matches/new.html.erb_spec.rb +++ b/spec/views/matches/new.html.erb_spec.rb @@ -3,7 +3,8 @@ require 'spec_helper' describe "matches/new" do before(:each) do assign(:match, stub_model(Match, - :tournament => nil + :tournament => nil, + :name => "MyString" ).as_new_record) end @@ -13,6 +14,7 @@ describe "matches/new" do # Run the generator again with the --webrat flag if you want to use webrat matchers assert_select "form[action=?][method=?]", matches_path, "post" do assert_select "input#match_tournament[name=?]", "match[tournament]" + assert_select "input#match_name[name=?]", "match[name]" end end end diff --git a/spec/views/matches/show.html.erb_spec.rb b/spec/views/matches/show.html.erb_spec.rb index 4460feb..642119d 100644 --- a/spec/views/matches/show.html.erb_spec.rb +++ b/spec/views/matches/show.html.erb_spec.rb @@ -3,7 +3,8 @@ require 'spec_helper' describe "matches/show" do before(:each) do @match = assign(:match, stub_model(Match, - :tournament => nil + :tournament => nil, + :name => "Name" )) end @@ -11,5 +12,6 @@ describe "matches/show" do render # Run the generator again with the --webrat flag if you want to use webrat matchers rendered.should match(//) + rendered.should match(/Name/) end end -- cgit v1.2.3-54-g00ecf