debian-mirror-gitlab/spec/features/merge_request/user_reviews_image_spec.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

38 lines
1.1 KiB
Ruby
Raw Normal View History

2020-06-23 00:09:42 +05:30
# frozen_string_literal: true
require 'spec_helper'
2023-03-17 16:20:25 +05:30
RSpec.describe 'Merge request > image review', :js, feature_category: :code_review_workflow do
2020-06-23 00:09:42 +05:30
include MergeRequestDiffHelpers
include RepoHelpers
2022-04-04 11:22:00 +05:30
let(:user) { project.first_owner }
2020-06-23 00:09:42 +05:30
let(:project) { create(:project, :repository) }
let(:merge_request) { create(:merge_request_with_diffs, :with_image_diffs, source_project: project, author: user) }
before do
sign_in(user)
allow_any_instance_of(DiffHelper).to receive(:diff_file_blob_raw_url).and_return('/apple-touch-icon.png')
allow_any_instance_of(DiffHelper).to receive(:diff_file_old_blob_raw_url).and_return('/favicon.png')
visit diffs_project_merge_request_path(merge_request.project, merge_request)
wait_for_requests
end
it 'leaves review' do
find('.js-add-image-diff-note-button', match: :first).click
find('.diff-content .note-textarea').native.send_keys('image diff test comment')
click_button('Start a review')
wait_for_requests
page.within(find('.draft-note-component')) do
expect(page).to have_content('image diff test comment')
end
end
end