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/merge_request/user_squashes_merge_request_spec.rb')
-rw-r--r--spec/features/merge_request/user_squashes_merge_request_spec.rb28
1 files changed, 20 insertions, 8 deletions
diff --git a/spec/features/merge_request/user_squashes_merge_request_spec.rb b/spec/features/merge_request/user_squashes_merge_request_spec.rb
index 63faf830f7e..200f310d929 100644
--- a/spec/features/merge_request/user_squashes_merge_request_spec.rb
+++ b/spec/features/merge_request/user_squashes_merge_request_spec.rb
@@ -3,6 +3,8 @@
require 'spec_helper'
RSpec.describe 'User squashes a merge request', :js, feature_category: :code_review_workflow do
+ include ContentEditorHelpers
+
let(:user) { create(:user) }
let(:project) { create(:project, :repository) }
let(:source_branch) { 'csv' }
@@ -12,19 +14,25 @@ RSpec.describe 'User squashes a merge request', :js, feature_category: :code_rev
shared_examples 'squash' do
it 'squashes the commits into a single commit, and adds a merge commit', :sidekiq_might_not_need_inline do
+ close_rich_text_promo_popover_if_present
+
expect(page).to have_content('Merged')
latest_master_commits = project.repository.commits_between(original_head.sha, 'master').map(&:raw)
- squash_commit = an_object_having_attributes(sha: a_string_matching(/\h{40}/),
- message: a_string_starting_with(project.merge_requests.first.default_squash_commit_message),
- author_name: user.name,
- committer_name: user.name)
+ squash_commit = an_object_having_attributes(
+ sha: a_string_matching(/\h{40}/),
+ message: a_string_starting_with(project.merge_requests.first.default_squash_commit_message),
+ author_name: user.name,
+ committer_name: user.name
+ )
- merge_commit = an_object_having_attributes(sha: a_string_matching(/\h{40}/),
- message: a_string_starting_with("Merge branch '#{source_branch}' into 'master'"),
- author_name: user.name,
- committer_name: user.name)
+ merge_commit = an_object_having_attributes(
+ sha: a_string_matching(/\h{40}/),
+ message: a_string_starting_with("Merge branch '#{source_branch}' into 'master'"),
+ author_name: user.name,
+ committer_name: user.name
+ )
expect(project.repository).not_to be_merged_to_root_ref(source_branch)
expect(latest_master_commits).to match([squash_commit, merge_commit])
@@ -33,12 +41,16 @@ RSpec.describe 'User squashes a merge request', :js, feature_category: :code_rev
shared_examples 'no squash' do
it 'accepts the merge request without squashing', :sidekiq_might_not_need_inline do
+ close_rich_text_promo_popover_if_present
+
expect(page).to have_content('Merged')
expect(project.repository).to be_merged_to_root_ref(source_branch)
end
end
def accept_mr
+ close_rich_text_promo_popover_if_present
+
expect(page).to have_button('Merge')
uncheck 'Delete source branch' unless protected_source_branch