mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-12 03:50:22 +00:00
BPUR: Add edit link for products and variants
This commit is contained in:
@@ -298,5 +298,37 @@ feature %q{
|
||||
page.should have_selector "a.delete-variant", :count => 2
|
||||
end
|
||||
end
|
||||
|
||||
describe "using edit buttons" do
|
||||
it "shows an edit button for products, which takes the user to the standard edit page for that product" do
|
||||
p1 = FactoryGirl.create(:product)
|
||||
p2 = FactoryGirl.create(:product)
|
||||
p3 = FactoryGirl.create(:product)
|
||||
login_to_admin_section
|
||||
|
||||
visit '/admin/products/bulk_index'
|
||||
|
||||
page.should have_selector "a.edit-product", :count => 3
|
||||
|
||||
first("a.edit-product").click
|
||||
|
||||
URI.parse(current_url).path.should == "/admin/products/#{p1.permalink}/edit"
|
||||
end
|
||||
|
||||
it "shows an edit button for variants, which takes the user to the standard edit page for that variant" do
|
||||
v1 = FactoryGirl.create(:variant)
|
||||
v2 = FactoryGirl.create(:variant)
|
||||
v3 = FactoryGirl.create(:variant)
|
||||
login_to_admin_section
|
||||
|
||||
visit '/admin/products/bulk_index'
|
||||
|
||||
page.should have_selector "a.edit-variant", :count => 3
|
||||
|
||||
first("a.edit-variant").click
|
||||
|
||||
URI.parse(current_url).path.should == "/admin/products/#{v1.product.permalink}/variants/#{v1.id}/edit"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user