mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-04 02:31:33 +00:00
Run transpec in spec/features/admin/enterprise_user_spec.rb and spec/features/admin/overview_spec.rb
This commit is contained in:
@@ -40,12 +40,12 @@ feature '
|
||||
|
||||
scenario "should not be able to see system configuration" do
|
||||
visit spree.edit_admin_general_settings_path
|
||||
page.should have_content 'Unauthorized'
|
||||
expect(page).to have_content 'Unauthorized'
|
||||
end
|
||||
|
||||
scenario "should not be able to see user management" do
|
||||
visit spree.admin_users_path
|
||||
page.should have_content 'Unauthorized'
|
||||
expect(page).to have_content 'Unauthorized'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -11,7 +11,7 @@ feature '
|
||||
context "as an enterprise user" do
|
||||
before do
|
||||
@enterprise_user = create_enterprise_user
|
||||
Spree::Admin::OverviewController.any_instance.stub(:spree_current_user).and_return @enterprise_user
|
||||
allow_any_instance_of(Spree::Admin::OverviewController).to receive(:spree_current_user).and_return @enterprise_user
|
||||
quick_login_as @enterprise_user
|
||||
end
|
||||
|
||||
@@ -24,8 +24,8 @@ feature '
|
||||
|
||||
it "displays a link to the map page" do
|
||||
visit '/admin'
|
||||
page.should have_selector ".dashboard_item h3", text: "Your profile live"
|
||||
page.should have_selector ".dashboard_item .button.bottom", text: "SEE #{d1.name.upcase} LIVE"
|
||||
expect(page).to have_selector ".dashboard_item h3", text: "Your profile live"
|
||||
expect(page).to have_selector ".dashboard_item .button.bottom", text: "SEE #{d1.name.upcase} LIVE"
|
||||
end
|
||||
|
||||
context "when visibilty is set to false" do
|
||||
@@ -36,7 +36,7 @@ feature '
|
||||
|
||||
it "displays a message telling how to set visibility" do
|
||||
visit '/admin'
|
||||
page.should have_selector ".alert-box", text: "To allow people to find you, turn on your visibility under Manage #{d1.name}."
|
||||
expect(page).to have_selector ".alert-box", text: "To allow people to find you, turn on your visibility under Manage #{d1.name}."
|
||||
end
|
||||
end
|
||||
|
||||
@@ -79,12 +79,12 @@ feature '
|
||||
context "but no products or order cycles" do
|
||||
it "prompts the user to create a new product and to manage order cycles" do
|
||||
visit '/admin'
|
||||
page.should have_selector ".dashboard_item#products h3", text: "Products"
|
||||
page.should have_selector ".dashboard_item#products .list-item", text: "You don't have any active products."
|
||||
page.should have_selector ".dashboard_item#products .button.bottom", text: "CREATE A NEW PRODUCT"
|
||||
page.should have_selector ".dashboard_item#order_cycles h3", text: "Order Cycles"
|
||||
page.should have_selector ".dashboard_item#order_cycles .list-item", text: "You don't have any active order cycles."
|
||||
page.should have_selector ".dashboard_item#order_cycles .button.bottom", text: "MANAGE ORDER CYCLES"
|
||||
expect(page).to have_selector ".dashboard_item#products h3", text: "Products"
|
||||
expect(page).to have_selector ".dashboard_item#products .list-item", text: "You don't have any active products."
|
||||
expect(page).to have_selector ".dashboard_item#products .button.bottom", text: "CREATE A NEW PRODUCT"
|
||||
expect(page).to have_selector ".dashboard_item#order_cycles h3", text: "Order Cycles"
|
||||
expect(page).to have_selector ".dashboard_item#order_cycles .list-item", text: "You don't have any active order cycles."
|
||||
expect(page).to have_selector ".dashboard_item#order_cycles .button.bottom", text: "MANAGE ORDER CYCLES"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -94,12 +94,12 @@ feature '
|
||||
|
||||
it "displays information about products and order cycles" do
|
||||
visit '/admin'
|
||||
page.should have_selector ".dashboard_item#products h3", text: "Products"
|
||||
page.should have_selector ".dashboard_item#products .list-item", text: "You don't have any active products."
|
||||
page.should have_selector ".dashboard_item#products .button.bottom", text: "CREATE A NEW PRODUCT"
|
||||
page.should have_selector ".dashboard_item#order_cycles h3", text: "Order Cycles"
|
||||
page.should have_selector ".dashboard_item#order_cycles .list-item", text: "You don't have any active order cycles."
|
||||
page.should have_selector ".dashboard_item#order_cycles .button.bottom", text: "MANAGE ORDER CYCLES"
|
||||
expect(page).to have_selector ".dashboard_item#products h3", text: "Products"
|
||||
expect(page).to have_selector ".dashboard_item#products .list-item", text: "You don't have any active products."
|
||||
expect(page).to have_selector ".dashboard_item#products .button.bottom", text: "CREATE A NEW PRODUCT"
|
||||
expect(page).to have_selector ".dashboard_item#order_cycles h3", text: "Order Cycles"
|
||||
expect(page).to have_selector ".dashboard_item#order_cycles .list-item", text: "You don't have any active order cycles."
|
||||
expect(page).to have_selector ".dashboard_item#order_cycles .button.bottom", text: "MANAGE ORDER CYCLES"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user