diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-20 16:18:24 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-20 16:18:24 +0300 |
commit | 0653e08efd039a5905f3fa4f6e9cef9f5d2f799c (patch) | |
tree | 4dcc884cf6d81db44adae4aa99f8ec1233a41f55 /spec/features/merge_requests | |
parent | 744144d28e3e7fddc117924fef88de5d9674fe4c (diff) |
Add latest changes from gitlab-org/gitlab@14-3-stable-eev14.3.0-rc42
Diffstat (limited to 'spec/features/merge_requests')
-rw-r--r-- | spec/features/merge_requests/rss_spec.rb | 46 | ||||
-rw-r--r-- | spec/features/merge_requests/user_sees_empty_state_spec.rb | 21 |
2 files changed, 67 insertions, 0 deletions
diff --git a/spec/features/merge_requests/rss_spec.rb b/spec/features/merge_requests/rss_spec.rb new file mode 100644 index 00000000000..9fc3d3d6ae1 --- /dev/null +++ b/spec/features/merge_requests/rss_spec.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe 'Project Merge Requests RSS' do + let_it_be(:user) { create(:user) } + let_it_be(:group) { create(:group) } + let_it_be(:project) { create(:project, :repository, group: group, visibility_level: Gitlab::VisibilityLevel::PUBLIC) } + let_it_be(:merge_request) { create(:merge_request, source_project: project, assignees: [user]) } + let_it_be(:path) { project_merge_requests_path(project) } + + before_all do + group.add_developer(user) + end + + context 'when signed in' do + let_it_be(:user) { create(:user) } + + before_all do + project.add_developer(user) + end + + before do + sign_in(user) + visit path + end + + it_behaves_like "it has an RSS button with current_user's feed token" + it_behaves_like "an autodiscoverable RSS feed with current_user's feed token" + end + + context 'when signed out' do + before do + visit path + end + + it_behaves_like "it has an RSS button without a feed token" + it_behaves_like "an autodiscoverable RSS feed without a feed token" + end + + describe 'feeds' do + it_behaves_like 'updates atom feed link', :project do + let(:path) { project_merge_requests_path(project, assignee_id: user.id) } + end + end +end diff --git a/spec/features/merge_requests/user_sees_empty_state_spec.rb b/spec/features/merge_requests/user_sees_empty_state_spec.rb index ac07b31731d..056da53c47b 100644 --- a/spec/features/merge_requests/user_sees_empty_state_spec.rb +++ b/spec/features/merge_requests/user_sees_empty_state_spec.rb @@ -3,6 +3,8 @@ require 'spec_helper' RSpec.describe 'Merge request > User sees empty state' do + include ProjectForksHelper + let(:project) { create(:project, :public, :repository) } let(:user) { project.creator } @@ -37,4 +39,23 @@ RSpec.describe 'Merge request > User sees empty state' do expect(page).to have_content('To widen your search, change or remove filters above') end end + + context 'as member of a fork' do + let(:fork_user) { create(:user) } + let(:forked_project) { fork_project(project, fork_user, namespace: fork_user.namespace, repository: true) } + + before do + forked_project.add_maintainer(fork_user) + sign_in(fork_user) + end + + it 'shows an empty state and a "New merge request" button' do + visit project_merge_requests_path(project, search: 'foo') + + expect(page).to have_selector('.empty-state') + within('.empty-state') do + expect(page).to have_link 'New merge request', href: project_new_merge_request_path(forked_project) + end + end + end end |