diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-07-20 21:07:04 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-07-20 21:07:04 +0300 |
commit | 3b7f1f7e093053f42674f950236b9733a08507cd (patch) | |
tree | a957a067b82d600cdce89a38d2e11b26d9d3bfcf /spec/features | |
parent | 58af7e4529e1762dea281938952bbba918d92cb9 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/users/rss_spec.rb | 57 |
1 files changed, 41 insertions, 16 deletions
diff --git a/spec/features/users/rss_spec.rb b/spec/features/users/rss_spec.rb index 39b6d049e43..2db58ce04a1 100644 --- a/spec/features/users/rss_spec.rb +++ b/spec/features/users/rss_spec.rb @@ -6,28 +6,53 @@ RSpec.describe 'User RSS', feature_category: :user_profile do let(:user) { create(:user) } let(:path) { user_path(create(:user)) } - before do - stub_feature_flags(user_profile_overflow_menu_vue: false) - end - - context 'when signed in' do + describe 'with "user_profile_overflow_menu_vue" feature flag off' do before do - sign_in(user) - visit path + stub_feature_flags(user_profile_overflow_menu_vue: false) end - it_behaves_like "it has an RSS button with current_user's feed token" - end + context 'when signed in' do + before do + sign_in(user) + visit path + end - context 'when signed out' do - before do - visit path + it_behaves_like "it has an RSS button with current_user's feed token" end - it_behaves_like "it has an RSS button without a feed token" + context 'when signed out' do + before do + visit path + end + + it_behaves_like "it has an RSS button without a feed token" + end end - # TODO: implement tests before the FF "user_profile_overflow_menu_vue" is turned on - # See: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/122971 - # Related Issue: https://gitlab.com/gitlab-org/gitlab/-/issues/416974 + describe 'with "user_profile_overflow_menu_vue" feature flag on', :js do + context 'when signed in' do + before do + sign_in(user) + visit path + end + + it 'shows the RSS link with overflow menu' do + find('[data-testid="base-dropdown-toggle"').click + + expect(page).to have_link 'Subscribe', href: /feed_token=glft-.*-#{user.id}/ + end + end + + context 'when signed out' do + before do + visit path + end + + it 'has an RSS without a feed token' do + find('[data-testid="base-dropdown-toggle"').click + + expect(page).not_to have_link 'Subscribe', href: /feed_token=glft-.*-#{user.id}/ + end + end + end end |