Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/features/users/rss_spec.rb')
-rw-r--r--spec/features/users/rss_spec.rb57
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