diff options
author | Bryce Johnson <bryce@gitlab.com> | 2017-05-24 16:03:35 -0400 |
---|---|---|
committer | Bryce Johnson <bryce@gitlab.com> | 2017-05-24 16:03:35 -0400 |
commit | 41e0029c9473edf8b3dde7cb564b1c64342f8faa (patch) | |
tree | f8c69a20f418c54d019d4264566cd83925244de8 | |
parent | 0eaa65d508eca7765e470018ab0d8006d0a8c9f8 (diff) | |
download | gitlab-ce-41e0029c9473edf8b3dde7cb564b1c64342f8faa.tar.gz |
Move spec and add one for merge button not disabled.
-rw-r--r-- | spec/features/merge_requests/widget_spec.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/features/merge_requests/widget_spec.rb b/spec/features/merge_requests/widget_spec.rb index ae799584c0f..ac10a1a1078 100644 --- a/spec/features/merge_requests/widget_spec.rb +++ b/spec/features/merge_requests/widget_spec.rb @@ -206,4 +206,33 @@ describe 'Merge request', :feature, :js do end end end + + context 'user can merge into source project but cannot push to fork', js: true do + let(:fork_project) { create(:project, :public) } + + let!(:merge_request_from_fork) do + create(:forked_project_link, forked_to_project: fork_project, + forked_from_project: project) + + create(:merge_request_with_diffs, source_project: fork_project, + target_project: project) + end + + let(:user2) { create(:user) } + + before do + project.team << [user2, :master] + logout + login_as user2 + visit namespace_project_merge_request_path(project.namespace, project, merge_request_from_fork) + end + + it 'user can merge into the source project' do + expect(page).to have_button('Merge', disabled: false) + end + + it 'user cannot remove source branch' do + expect(page).to have_field('remove-source-branch-input', disabled: true) + end + end end |