From 88efcf4da6a69acac85d46fb3597cf307138eefa Mon Sep 17 00:00:00 2001 From: Shiho Takagi Date: Sat, 17 Jan 2015 00:25:34 +1100 Subject: [PATCH] updated test spec for view change --- spec/views/crops/search.html.haml_spec.rb | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/spec/views/crops/search.html.haml_spec.rb b/spec/views/crops/search.html.haml_spec.rb index c186c6c4c..4462df9a5 100644 --- a/spec/views/crops/search.html.haml_spec.rb +++ b/spec/views/crops/search.html.haml_spec.rb @@ -11,8 +11,7 @@ describe "crops/search" do @tomato = FactoryGirl.create(:tomato) @roma = FactoryGirl.create(:crop, :name => 'Roma tomato', :parent => @tomato) assign(:search, 'tomato') - assign(:exact_match, @tomato) - assign(:partial_matches, [@roma]) + assign(:all_matches, [@tomato, @roma]) render end @@ -22,8 +21,8 @@ describe "crops/search" do end end - it "shows partial matches" do - assert_select "div#partial_matches" do + it "shows all matches" do + assert_select "div#all_matches" do assert_select "a[href=#{crop_path(@roma)}]" end end @@ -31,8 +30,7 @@ describe "crops/search" do context "no results" do before :each do - assign(:exact_match, nil) - assign(:partial_matches, []) + assign(:all_matches, []) assign(:search, 'tomato') render end