Fix merge request new view not changing code view rendering style

This commit is contained in:
Paco Guzman 2016-08-11 10:02:27 +02:00
parent 87b07f6a65
commit bbb019094b
3 changed files with 21 additions and 1 deletions

View File

@ -75,6 +75,7 @@ v 8.11.0 (unreleased)
- Speedup DiffNote#active? on discussions, preloading noteables and avoid touching git repository to return diff_refs when possible
- Add commit stats in commit api. !5517 (dixpac)
- Add CI configuration button on project page
- Fix merge request new view not changing code view rendering style
- Make error pages responsive (Takuya Noguchi)
- Fix skip_repo parameter being ignored when destroying a namespace
- Change requests_profiles resource constraint to catch virtually any file

View File

@ -142,6 +142,8 @@ class Projects::MergeRequestsController < Projects::ApplicationController
end
def new
apply_diff_view_cookie!
build_merge_request
@noteable = @merge_request

View File

@ -8,10 +8,11 @@ feature 'Create New Merge Request', feature: true, js: true do
project.team << [user, :master]
login_as user
visit namespace_project_merge_requests_path(project.namespace, project)
end
it 'generates a diff for an orphaned branch' do
visit namespace_project_merge_requests_path(project.namespace, project)
click_link 'New Merge Request'
first('.js-source-branch').click
@ -40,4 +41,20 @@ feature 'Create New Merge Request', feature: true, js: true do
expect(page).not_to have_content private_project.to_reference
end
end
it 'allows to change the diff view' do
visit new_namespace_project_merge_request_path(project.namespace, project, merge_request: { target_branch: 'master', source_branch: 'fix' })
click_link 'Changes'
expect(page.find_link('Inline')[:class]).to match(/\bactive\b/)
expect(page.find_link('Side-by-side')[:class]).not_to match(/\bactive\b/)
click_link 'Side-by-side'
click_link 'Changes'
expect(page.find_link('Inline')[:class]).not_to match(/\bactive\b/)
expect(page.find_link('Side-by-side')[:class]).to match(/\bactive\b/)
end
end