diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-17 21:09:00 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-17 21:09:00 +0300 |
commit | eb1f5a3e087b7d6a3e85f2724b5a475cc9d9d37d (patch) | |
tree | d572a6d931152ae0dd10427237f5811893438552 /spec/features | |
parent | b304a72312465ed4c0a568ee6a6ea5e97f705c9b (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features')
8 files changed, 22 insertions, 71 deletions
diff --git a/spec/features/admin/admin_settings_spec.rb b/spec/features/admin/admin_settings_spec.rb index 7bc904be69d..9b275a8897b 100644 --- a/spec/features/admin/admin_settings_spec.rb +++ b/spec/features/admin/admin_settings_spec.rb @@ -326,6 +326,8 @@ describe 'Admin updates settings', :clean_gitlab_redis_shared_state, :do_not_moc end it 'loads usage ping payload on click', :js do + allow(ActiveRecord::Base.connection).to receive(:transaction_open?).and_return(false) + expect(page).to have_button 'Preview payload' find('.js-usage-ping-payload-trigger').click diff --git a/spec/features/merge_request/user_creates_image_diff_notes_spec.rb b/spec/features/merge_request/user_creates_image_diff_notes_spec.rb index e0724a04ea3..e1b139c1b3b 100644 --- a/spec/features/merge_request/user_creates_image_diff_notes_spec.rb +++ b/spec/features/merge_request/user_creates_image_diff_notes_spec.rb @@ -48,29 +48,11 @@ describe 'Merge request > User creates image diff notes', :js do let(:commit) { project.commit('2f63565e7aac07bcdadb654e253078b727143ec4') } let(:note1_position) do - Gitlab::Diff::Position.new( - old_path: path, - new_path: path, - width: 100, - height: 100, - x: 10, - y: 10, - position_type: "image", - diff_refs: commit.diff_refs - ) + build(:image_diff_position, file: path, diff_refs: commit.diff_refs) end let(:note2_position) do - Gitlab::Diff::Position.new( - old_path: path, - new_path: path, - width: 100, - height: 100, - x: 20, - y: 20, - position_type: "image", - diff_refs: commit.diff_refs - ) + build(:image_diff_position, file: path, diff_refs: commit.diff_refs) end let!(:note1) { create(:diff_note_on_commit, commit_id: commit.id, project: project, position: note1_position, note: 'my note 1') } @@ -93,16 +75,7 @@ describe 'Merge request > User creates image diff notes', :js do %w(inline parallel).each do |view| context "#{view} view" do let(:position) do - Gitlab::Diff::Position.new( - old_path: path, - new_path: path, - width: 100, - height: 100, - x: 1, - y: 1, - position_type: "image", - diff_refs: merge_request.diff_refs - ) + build(:image_diff_position, file: path, diff_refs: merge_request.diff_refs) end let!(:note) { create(:diff_note_on_merge_request, project: project, noteable: merge_request, position: position) } @@ -167,16 +140,7 @@ describe 'Merge request > User creates image diff notes', :js do let(:path) { "files/images/ee_repo_logo.png" } let(:position) do - Gitlab::Diff::Position.new( - old_path: path, - new_path: path, - width: 100, - height: 100, - x: 50, - y: 50, - position_type: "image", - diff_refs: merge_request.diff_refs - ) + build(:image_diff_position, file: path, diff_refs: merge_request.diff_refs) end before do diff --git a/spec/features/merge_request/user_resolves_diff_notes_and_discussions_resolve_spec.rb b/spec/features/merge_request/user_resolves_diff_notes_and_discussions_resolve_spec.rb index 5a7edd37182..38a31d3bbd9 100644 --- a/spec/features/merge_request/user_resolves_diff_notes_and_discussions_resolve_spec.rb +++ b/spec/features/merge_request/user_resolves_diff_notes_and_discussions_resolve_spec.rb @@ -10,13 +10,9 @@ describe 'Merge request > User resolves diff notes and threads', :js do let!(:note) { create(:diff_note_on_merge_request, project: project, noteable: merge_request, note: "| Markdown | Table |\n|-------|---------|\n| first | second |") } let(:path) { "files/ruby/popen.rb" } let(:position) do - Gitlab::Diff::Position.new( - old_path: path, - new_path: path, - old_line: nil, - new_line: 9, - diff_refs: merge_request.diff_refs - ) + build(:text_diff_position, + file: path, old_line: nil, new_line: 9, + diff_refs: merge_request.diff_refs) end before do diff --git a/spec/features/merge_request/user_resolves_outdated_diff_discussions_spec.rb b/spec/features/merge_request/user_resolves_outdated_diff_discussions_spec.rb index b40c11f0d47..9f7c97e510c 100644 --- a/spec/features/merge_request/user_resolves_outdated_diff_discussions_spec.rb +++ b/spec/features/merge_request/user_resolves_outdated_diff_discussions_spec.rb @@ -13,20 +13,16 @@ describe 'Merge request > User resolves outdated diff discussions', :js do let(:current_diff_refs) { merge_request.diff_refs } let(:outdated_position) do - Gitlab::Diff::Position.new( - old_path: 'files/csv/Book1.csv', - new_path: 'files/csv/Book1.csv', - old_line: nil, + build(:text_diff_position, :added, + file: 'files/csv/Book1.csv', new_line: 9, diff_refs: outdated_diff_refs ) end let(:current_position) do - Gitlab::Diff::Position.new( - old_path: 'files/csv/Book1.csv', - new_path: 'files/csv/Book1.csv', - old_line: nil, + build(:text_diff_position, :added, + file: 'files/csv/Book1.csv', new_line: 1, diff_refs: current_diff_refs ) diff --git a/spec/features/merge_request/user_sees_avatar_on_diff_notes_spec.rb b/spec/features/merge_request/user_sees_avatar_on_diff_notes_spec.rb index 3e77b9e75d6..c482d783bab 100644 --- a/spec/features/merge_request/user_sees_avatar_on_diff_notes_spec.rb +++ b/spec/features/merge_request/user_sees_avatar_on_diff_notes_spec.rb @@ -10,10 +10,8 @@ describe 'Merge request > User sees avatars on diff notes', :js do let(:merge_request) { create(:merge_request_with_diffs, source_project: project, author: user, title: 'Bug NS-04') } let(:path) { 'files/ruby/popen.rb' } let(:position) do - Gitlab::Diff::Position.new( - old_path: path, - new_path: path, - old_line: nil, + build(:text_diff_position, :added, + file: path, new_line: 9, diff_refs: merge_request.diff_refs ) diff --git a/spec/features/merge_request/user_sees_discussions_spec.rb b/spec/features/merge_request/user_sees_discussions_spec.rb index 319eee0c55a..b4afd8c6332 100644 --- a/spec/features/merge_request/user_sees_discussions_spec.rb +++ b/spec/features/merge_request/user_sees_discussions_spec.rb @@ -18,10 +18,8 @@ describe 'Merge request > User sees threads', :js do let!(:outdated_discussion) { create(:diff_note_on_merge_request, project: project, noteable: merge_request, position: outdated_position).to_discussion } let!(:active_discussion) { create(:diff_note_on_merge_request, noteable: merge_request, project: project).to_discussion } let(:outdated_position) do - Gitlab::Diff::Position.new( - old_path: "files/ruby/popen.rb", - new_path: "files/ruby/popen.rb", - old_line: nil, + build(:text_diff_position, :added, + file: "files/ruby/popen.rb", new_line: 9, diff_refs: outdated_diff_refs ) diff --git a/spec/features/merge_request/user_sees_versions_spec.rb b/spec/features/merge_request/user_sees_versions_spec.rb index cd62bab412a..5b43fe407eb 100644 --- a/spec/features/merge_request/user_sees_versions_spec.rb +++ b/spec/features/merge_request/user_sees_versions_spec.rb @@ -86,10 +86,8 @@ describe 'Merge request > User sees versions', :js do it 'shows comments that were last relevant at that version' do expect(page).to have_content '5 files' - position = Gitlab::Diff::Position.new( - old_path: ".gitmodules", - new_path: ".gitmodules", - old_line: nil, + position = build(:text_diff_position, :added, + file: ".gitmodules", new_line: 4, diff_refs: merge_request_diff1.diff_refs ) @@ -136,9 +134,8 @@ describe 'Merge request > User sees versions', :js do expect(additions_content).to eq '15' expect(deletions_content).to eq '6' - position = Gitlab::Diff::Position.new( - old_path: ".gitmodules", - new_path: ".gitmodules", + position = build(:text_diff_position, + file: ".gitmodules", old_line: 4, new_line: 4, diff_refs: merge_request_diff3.compare_with(merge_request_diff1.head_commit_sha).diff_refs diff --git a/spec/features/projects/settings/operations_settings_spec.rb b/spec/features/projects/settings/operations_settings_spec.rb index 0181ceed5b9..d57401471ff 100644 --- a/spec/features/projects/settings/operations_settings_spec.rb +++ b/spec/features/projects/settings/operations_settings_spec.rb @@ -58,7 +58,7 @@ describe 'Projects > Settings > For a forked project', :js do end def click_expand_incident_management_button - within '.js-incident-management-settings' do + within '.qa-incident-management-settings' do click_button('Expand') end end |