2020-07-28 12:09:49 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
RSpec.describe 'User views diffs file-by-file', :js do
|
|
|
|
let(:merge_request) do
|
|
|
|
create(:merge_request, source_branch: 'squash-large-files', source_project: project, target_project: project)
|
|
|
|
end
|
|
|
|
|
|
|
|
let(:project) { create(:project, :repository) }
|
|
|
|
let(:user) { create(:user, view_diffs_file_by_file: true) }
|
|
|
|
|
|
|
|
before do
|
|
|
|
project.add_developer(user)
|
|
|
|
|
|
|
|
sign_in(user)
|
|
|
|
|
|
|
|
visit(diffs_project_merge_request_path(project, merge_request, anchor: '5091f7b9dd6202e37eaedd73d7b75d82f25fdb61'))
|
|
|
|
|
|
|
|
wait_for_requests
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'shows diffs file-by-file' do
|
|
|
|
page.within('#diffs') do
|
|
|
|
expect(page).not_to have_content('This diff is collapsed')
|
|
|
|
|
2020-08-20 15:10:18 +00:00
|
|
|
find('.page-link.next-page-item').click
|
2020-07-28 12:09:49 +00:00
|
|
|
|
|
|
|
expect(page).not_to have_content('This diff is collapsed')
|
2020-08-20 15:10:18 +00:00
|
|
|
expect(page).to have_selector('.diff-file .file-title', text: 'large_diff_renamed.md')
|
2020-07-28 12:09:49 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|