diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-07-24 17:16:09 +0300 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-07-30 16:01:26 +0300 |
commit | 9252414078c61a9642889d19fd166cf658492ef2 (patch) | |
tree | 2b456a25dc9375b28af242171c7c9c4b702a84fb /spec/features | |
parent | f1d3ea63cf74d2791a9a863b29ab2d919ea61bd0 (diff) |
Hide the status fields behind a feature flag
Since the frontend for this feature isn't ready, better to hide the
confusing field behind a feature flag.
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/profiles/user_edit_profile_spec.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/features/profiles/user_edit_profile_spec.rb b/spec/features/profiles/user_edit_profile_spec.rb index 0b5eacbe916..96bbe6f93f1 100644 --- a/spec/features/profiles/user_edit_profile_spec.rb +++ b/spec/features/profiles/user_edit_profile_spec.rb @@ -55,4 +55,31 @@ describe 'User edit profile' do expect(page).to have_link('gravatar.com') end end + + context 'user status' do + it 'hides user status when the feature is disabled' do + stub_feature_flags(user_status_form: false) + + visit(profile_path) + + expect(page).not_to have_content('Current Status') + end + + it 'shows the status form when the feature is enabled' do + stub_feature_flags(user_status_form: true) + + visit(profile_path) + + expect(page).to have_content('Current Status') + end + + it 'shows the status form when the feature is enabled by setting a cookie', :js do + stub_feature_flags(user_status_form: false) + set_cookie('feature_user_status_form', 'true') + + visit(profile_path) + + expect(page).to have_content('Current Status') + end + end end |