updated test spec for view change

This commit is contained in:
Shiho Takagi
2015-01-17 00:25:34 +11:00
parent 556ba33172
commit 88efcf4da6

View File

@@ -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