diff --git a/app/views/registration/index.html.haml b/app/views/registration/index.html.haml index 4f23ac8700..fbfb0c175c 100644 --- a/app/views/registration/index.html.haml +++ b/app/views/registration/index.html.haml @@ -6,7 +6,7 @@ = inject_enterprise_attributes - steps = %w{about contact details finished images introduction} -- steps += %w{limit_reached logo promo social steps type} +- steps += %w{logo promo social steps type} - steps.each do |step| = render partial: "registration/steps/#{step}" = render "modal" diff --git a/app/views/registration/limit_reached.html.haml b/app/views/registration/limit_reached.html.haml index bfaec6da3d..35132cb769 100644 --- a/app/views/registration/limit_reached.html.haml +++ b/app/views/registration/limit_reached.html.haml @@ -1,2 +1,4 @@ += render partial: "registration/steps/limit_reached" + / Directive which loads the modal %div{ "ofn-registration-limit-modal" => true } diff --git a/spec/features/consumer/registration_spec.rb b/spec/features/consumer/registration_spec.rb index f6a90f6f61..c4e7af36ee 100644 --- a/spec/features/consumer/registration_spec.rb +++ b/spec/features/consumer/registration_spec.rb @@ -98,6 +98,23 @@ feature "Registration", js: true do expect(e.instagram).to eq "@InStAgRaM" end + context "when the user has no more remaining enterprises" do + before do + user.update_attributes(enterprise_limit: 0) + end + + it "displays the limit reached page" do + visit registration_path + + expect(page).to have_selector "dd", text: "Login" + switch_to_login_tab + + # Enter Login details + fill_in "Email", with: user.email + fill_in "Password", with: user.password + click_login_and_ensure_content I18n.t('limit_reached_headline') + end + end end describe "Terms of Service agreement" do