Commit bbb01909 authored by Paco Guzman's avatar Paco Guzman

Fix merge request new view not changing code view rendering style

parent 87b07f6a
...@@ -75,6 +75,7 @@ v 8.11.0 (unreleased) ...@@ -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 - 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 commit stats in commit api. !5517 (dixpac)
- Add CI configuration button on project page - Add CI configuration button on project page
- Fix merge request new view not changing code view rendering style
- Make error pages responsive (Takuya Noguchi) - Make error pages responsive (Takuya Noguchi)
- Fix skip_repo parameter being ignored when destroying a namespace - Fix skip_repo parameter being ignored when destroying a namespace
- Change requests_profiles resource constraint to catch virtually any file - Change requests_profiles resource constraint to catch virtually any file
......
...@@ -142,6 +142,8 @@ class Projects::MergeRequestsController < Projects::ApplicationController ...@@ -142,6 +142,8 @@ class Projects::MergeRequestsController < Projects::ApplicationController
end end
def new def new
apply_diff_view_cookie!
build_merge_request build_merge_request
@noteable = @merge_request @noteable = @merge_request
......
...@@ -8,10 +8,11 @@ feature 'Create New Merge Request', feature: true, js: true do ...@@ -8,10 +8,11 @@ feature 'Create New Merge Request', feature: true, js: true do
project.team << [user, :master] project.team << [user, :master]
login_as user login_as user
visit namespace_project_merge_requests_path(project.namespace, project)
end end
it 'generates a diff for an orphaned branch' do it 'generates a diff for an orphaned branch' do
visit namespace_project_merge_requests_path(project.namespace, project)
click_link 'New Merge Request' click_link 'New Merge Request'
first('.js-source-branch').click first('.js-source-branch').click
...@@ -40,4 +41,20 @@ feature 'Create New Merge Request', feature: true, js: true do ...@@ -40,4 +41,20 @@ feature 'Create New Merge Request', feature: true, js: true do
expect(page).not_to have_content private_project.to_reference expect(page).not_to have_content private_project.to_reference
end end
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 end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment