diff options
author | Dustin Utecht <me@dustin-utecht.de> | 2018-07-09 17:49:33 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2018-07-09 17:49:33 +0300 |
commit | 1da22cec12cc2c82fdc59b648149dde55b3fd7b3 (patch) | |
tree | c03a3c24092ed41c08cc3c077edc87ce8075f222 /spec/features/users | |
parent | 9a9b4444ac176dbfda8ed38653550931fe7671f3 (diff) |
Show "Sign in" instead of "Sign in / Register" when sign up is disabled
Diffstat (limited to 'spec/features/users')
-rw-r--r-- | spec/features/users/show_spec.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/features/users/show_spec.rb b/spec/features/users/show_spec.rb index b5bbb2c0ea5..3e2fb704bc6 100644 --- a/spec/features/users/show_spec.rb +++ b/spec/features/users/show_spec.rb @@ -14,4 +14,28 @@ describe 'User page' do expect(page).to have_link('Snippets') end end + + context 'signup disabled' do + it 'shows the sign in link' do + stub_application_setting(signup_enabled: false) + + visit(user_path(user)) + + page.within '.navbar-nav' do + expect(page).to have_link('Sign in') + end + end + end + + context 'signup enabled' do + it 'shows the sign in and register link' do + stub_application_setting(signup_enabled: true) + + visit(user_path(user)) + + page.within '.navbar-nav' do + expect(page).to have_link('Sign in / Register') + end + end + end end |