gitlab-org--gitlab-foss/spec/features/merge_request/user_expands_diff_spec.rb
Phil Hughes 2ed65be1c3
Fixed renamed and mode changed diff viewers
Renders mode changed and renamed file merge request diff
viewers on the frontend.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/52607
2018-12-06 14:39:29 +00:00

26 lines
833 B
Ruby

require 'spec_helper'
describe 'User expands diff', :js do
let(:project) { create(:project, :public, :repository) }
let(:merge_request) { create(:merge_request, source_branch: 'expand-collapse-files', source_project: project, target_project: project) }
before do
allow(Gitlab::Git::Diff).to receive(:size_limit).and_return(100.kilobytes)
allow(Gitlab::Git::Diff).to receive(:collapse_limit).and_return(10.kilobytes)
visit(diffs_project_merge_request_path(project, merge_request))
wait_for_requests
end
it 'allows user to expand diff' do
page.within find('[id="2f6fcd96b88b36ce98c38da085c795a27d92a3dd"]') do
click_link 'Click to expand it.'
wait_for_requests
expect(page).not_to have_content('Click to expand it.')
expect(page).to have_selector('.code')
end
end
end