Splits tests into existing/non-existing shops

Sets failing tests as pending for issues #9649 and #5467
This commit is contained in:
filipefurtad0
2022-09-08 12:04:27 +01:00
parent 9843e0e450
commit 215f3e97ad

View File

@@ -23,9 +23,38 @@ describe 'Shops', js: true do
producer.set_producer_property 'Organic', 'NASAA 12345'
end
it "searches by URL" do
visit shops_path(anchor: "/?query=xyzzy")
expect(page).to have_content "Sorry, no results found for xyzzy"
context "searching enterprises" do
context "which exist" do
it "by URL" do
visit shops_path(anchor: "/?query=Enterprise")
expect(page).to have_content "Did you mean? #{distributor.name}"
end
it "by typing in the search field" do
visit shops_path
find('input').set("Enterprise")
expect(current_url).to have_content("/shops#/?query=Enterprise")
expect(page).to have_content "Did you mean? #{distributor.name}"
end
end
context "which do not exist" do
it "by URL" do
pending("#9649")
visit shops_path(anchor: "/?query=xyzzy")
expect(page).not_to have_content distributor.name
expect(page).to have_content "Sorry, no results found for xyzzy. Try another search?"
end
it "by typing in the search field" do
pending("#5467")
visit shops_path
find('input').set("xyzzy")
expect(current_url).to have_content("/shops#/?query=xyzzy")
expect(page).not_to have_content distributor.name
expect(page).to have_content "Sorry, no results found for xyzzy. Try another search?"
end
end
end
describe "listing shops" do