From 3c5b01ece07eb4a892c95e85886f48e1717537f3 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley Date: Tue, 23 Jan 2018 20:47:18 +0000 Subject: [PATCH] Update enterprise limit spec --- spec/features/admin/enterprises_spec.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/spec/features/admin/enterprises_spec.rb b/spec/features/admin/enterprises_spec.rb index 8343c03244..448933bac7 100644 --- a/spec/features/admin/enterprises_spec.rb +++ b/spec/features/admin/enterprises_spec.rb @@ -312,7 +312,7 @@ feature %q{ end context "when I have reached my enterprise ownership limit" do - it "does not display the link to create a new enterprise" do + it "shows a 'limit reached' modal message when trying to create a new enterprise" do supplier1.reload enterprise_user.owned_enterprises.push [supplier1] @@ -320,7 +320,13 @@ feature %q{ page.should have_content supplier1.name page.should have_content distributor1.name - expect(find("#content-header")).to_not have_link "New Enterprise" + + within 'li#new_product_link' do + expect(page).to have_link 'New Enterprise', href: '#' + click_link 'New Enterprise' + end + + expect(page).to have_content I18n.t('js.admin.enterprise_limit_reached', contact_email: ContentConfig.footer_email) end end