diff options
author | Rémy Coutable <remy@rymai.me> | 2018-07-17 12:04:48 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2018-07-17 12:04:48 +0000 |
commit | 2ecf9851d76defa17119612535a92c636662cbcf (patch) | |
tree | 91854e91de1a1527417ec7f4cbb9aeb81ec44cf9 /spec/features | |
parent | 9c1a3bce9d57cb03f86c9c1abc7f2a7c78d29f37 (diff) | |
parent | 4201d428572827e8e4c8abd094fa8c517dfa7839 (diff) | |
download | gitlab-ce-2ecf9851d76defa17119612535a92c636662cbcf.tar.gz |
Merge branch 'close-revert-and-cherry-pick-modal-on-escape-keypress' into 'master'
Close revert and cherry pick modal on escape keypress
See merge request gitlab-org/gitlab-ce!20341
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/merge_request/user_sees_check_out_branch_modal_spec.rb | 4 | ||||
-rw-r--r-- | spec/features/merge_request/user_sees_cherry_pick_modal_spec.rb (renamed from spec/features/merge_request/user_cherry_picks_spec.rb) | 22 | ||||
-rw-r--r-- | spec/features/user_sees_revert_modal_spec.rb | 25 |
3 files changed, 47 insertions, 4 deletions
diff --git a/spec/features/merge_request/user_sees_check_out_branch_modal_spec.rb b/spec/features/merge_request/user_sees_check_out_branch_modal_spec.rb index c40c720d168..86086a58f18 100644 --- a/spec/features/merge_request/user_sees_check_out_branch_modal_spec.rb +++ b/spec/features/merge_request/user_sees_check_out_branch_modal_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -describe 'Merge request > User sees Check out branch modal', :js do +describe 'Merge request > User sees check out branch modal', :js do let(:project) { create(:project, :public, :repository) } let(:user) { project.creator } let(:merge_request) { create(:merge_request, source_project: project) } @@ -16,7 +16,7 @@ describe 'Merge request > User sees Check out branch modal', :js do expect(page).to have_content('Check out, review, and merge locally') end - it 'closes the check out branch model with Escape keypress' do + it 'closes the check out branch modal with escape keypress' do find('#modal_merge_info').send_keys(:escape) expect(page).not_to have_content('Check out, review, and merge locally') diff --git a/spec/features/merge_request/user_cherry_picks_spec.rb b/spec/features/merge_request/user_sees_cherry_pick_modal_spec.rb index c6ec3f08cc5..aa499493dbe 100644 --- a/spec/features/merge_request/user_cherry_picks_spec.rb +++ b/spec/features/merge_request/user_sees_cherry_pick_modal_spec.rb @@ -21,7 +21,7 @@ describe 'Merge request > User cherry-picks', :js do end # Fast-forward merge, or merged before GitLab 8.5. - context 'Without a merge commit' do + context 'without a merge commit' do before do merge_request.merge_commit_sha = nil merge_request.save @@ -34,7 +34,7 @@ describe 'Merge request > User cherry-picks', :js do end end - context 'With a merge commit' do + context 'with a merge commit' do it 'shows a Cherry-pick button' do visit project_merge_request_path(project, merge_request) @@ -49,5 +49,23 @@ describe 'Merge request > User cherry-picks', :js do expect(page).not_to have_link 'Cherry-pick' end end + + context 'and seeing the cherry-pick modal' do + before do + visit project_merge_request_path(project, merge_request) + + click_link('Cherry-pick') + end + + it 'shows the cherry-pick modal' do + expect(page).to have_content('Cherry-pick this merge request') + end + + it 'closes the cherry-pick modal with escape keypress' do + find('#modal-cherry-pick-commit').send_keys(:escape) + + expect(page).not_to have_content('Start a new merge request with these changes') + end + end end end diff --git a/spec/features/user_sees_revert_modal_spec.rb b/spec/features/user_sees_revert_modal_spec.rb new file mode 100644 index 00000000000..11a9e470f76 --- /dev/null +++ b/spec/features/user_sees_revert_modal_spec.rb @@ -0,0 +1,25 @@ +require 'rails_helper' + +describe 'Merge request > User sees revert modal', :js do + let(:project) { create(:project, :public, :repository) } + let(:user) { project.creator } + let(:merge_request) { create(:merge_request, source_project: project) } + + before do + sign_in(user) + visit(project_merge_request_path(project, merge_request)) + click_button('Merge') + visit(merge_request_path(merge_request)) + click_link('Revert') + end + + it 'shows the revert modal' do + expect(page).to have_content('Revert this merge request') + end + + it 'closes the revert modal with escape keypress' do + find('#modal-revert-commit').send_keys(:escape) + + expect(page).not_to have_content('Revert this merge request') + end +end |