mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-02-18 14:48:24 -05:00
updated test spec for view change
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user