From d8ce0e7d58d0b68dcb42d2dc888792bbaccebc45 Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Thu, 24 Nov 2016 13:35:04 +1100 Subject: [PATCH] A user without enterprises does not have access to the dashboard, so it's not meaningful to spec --- spec/features/admin/overview_spec.rb | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/spec/features/admin/overview_spec.rb b/spec/features/admin/overview_spec.rb index 590c8528e8..ebe6a1d379 100644 --- a/spec/features/admin/overview_spec.rb +++ b/spec/features/admin/overview_spec.rb @@ -3,31 +3,18 @@ require 'spec_helper' feature %q{ As a backend user I want to be given information about the state of my enterprises, products and order cycles -} , js: true do +}, js: true do include AuthenticationWorkflow include AuthorizationHelpers include WebHelper - stub_authorization! - context "as an enterprise user" do - before :each do + before do @enterprise_user = create_enterprise_user Spree::Admin::OverviewController.any_instance.stub(:spree_current_user).and_return @enterprise_user quick_login_as @enterprise_user end - context "with no enterprises" do - it "prompts the user to create a new enteprise" do - visit '/admin' - page.should have_selector ".dashboard_item#enterprises h3", text: "My Enterprises" - page.should have_selector ".dashboard_item#enterprises .list-item", text: "You don't have any enterprises yet" - page.should have_selector ".dashboard_item#enterprises .button.bottom", text: "CREATE A NEW ENTERPRISE" - page.should_not have_selector ".dashboard_item#products" - page.should_not have_selector ".dashboard_item#order_cycles" - end - end - context "with an enterprise" do let(:d1) { create(:distributor_enterprise) }