From ec7e92202ba6f0cfc13c626a419fdaae895c8f24 Mon Sep 17 00:00:00 2001 From: luisramos0 Date: Fri, 10 May 2019 14:36:07 +0100 Subject: [PATCH] Run transpec in spec/features/admin/enterprise_user_spec.rb and spec/features/admin/overview_spec.rb --- spec/features/admin/enterprise_user_spec.rb | 4 +-- spec/features/admin/overview_spec.rb | 32 ++++++++++----------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/spec/features/admin/enterprise_user_spec.rb b/spec/features/admin/enterprise_user_spec.rb index cc6f9e20f2..6b4f4dd778 100644 --- a/spec/features/admin/enterprise_user_spec.rb +++ b/spec/features/admin/enterprise_user_spec.rb @@ -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 diff --git a/spec/features/admin/overview_spec.rb b/spec/features/admin/overview_spec.rb index b1ff6e12e6..3d472dac2f 100644 --- a/spec/features/admin/overview_spec.rb +++ b/spec/features/admin/overview_spec.rb @@ -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