Commit 1574a921 authored by Rémy Coutable's avatar Rémy Coutable

Resolve conflicts

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent 8486c8e5
...@@ -28,15 +28,9 @@ module RoutableActions ...@@ -28,15 +28,9 @@ module RoutableActions
return unless request.get? return unless request.get?
canonical_path = routable.full_path canonical_path = routable.full_path
<<<<<<< HEAD
if canonical_path != requested_path
if canonical_path.casecmp(requested_path) != 0
flash[:notice] = "#{routable.class.to_s.titleize} '#{requested_path}' was moved to '#{canonical_path}'. Please update any links and bookmarks that may still have the old path."
=======
if canonical_path != requested_full_path if canonical_path != requested_full_path
if canonical_path.casecmp(requested_full_path) != 0 if canonical_path.casecmp(requested_full_path) != 0
flash[:notice] = "#{routable.class.to_s.titleize} '#{requested_full_path}' was moved to '#{canonical_path}'. Please update any links and bookmarks that may still have the old path." flash[:notice] = "#{routable.class.to_s.titleize} '#{requested_full_path}' was moved to '#{canonical_path}'. Please update any links and bookmarks that may still have the old path."
>>>>>>> origin/master
end end
redirect_to build_canonical_path(routable) redirect_to build_canonical_path(routable)
end end
......
...@@ -84,7 +84,6 @@ describe GroupsController do ...@@ -84,7 +84,6 @@ describe GroupsController do
expect(assigns(:issues)).to eq [issue_2, issue_1] expect(assigns(:issues)).to eq [issue_2, issue_1]
end end
end end
<<<<<<< HEAD
context 'when requesting the canonical path with different casing' do context 'when requesting the canonical path with different casing' do
it 'redirects to the correct casing' do it 'redirects to the correct casing' do
...@@ -105,8 +104,6 @@ describe GroupsController do ...@@ -105,8 +104,6 @@ describe GroupsController do
expect(controller).to set_flash[:notice].to(group_moved_message(redirect_route, group)) expect(controller).to set_flash[:notice].to(group_moved_message(redirect_route, group))
end end
end end
=======
>>>>>>> origin/master
end end
describe 'GET #merge_requests' do describe 'GET #merge_requests' do
...@@ -132,7 +129,6 @@ describe GroupsController do ...@@ -132,7 +129,6 @@ describe GroupsController do
expect(assigns(:merge_requests)).to eq [merge_request_2, merge_request_1] expect(assigns(:merge_requests)).to eq [merge_request_2, merge_request_1]
end end
end end
<<<<<<< HEAD
context 'when requesting the canonical path with different casing' do context 'when requesting the canonical path with different casing' do
it 'redirects to the correct casing' do it 'redirects to the correct casing' do
...@@ -153,8 +149,6 @@ describe GroupsController do ...@@ -153,8 +149,6 @@ describe GroupsController do
expect(controller).to set_flash[:notice].to(group_moved_message(redirect_route, group)) expect(controller).to set_flash[:notice].to(group_moved_message(redirect_route, group))
end end
end end
=======
>>>>>>> origin/master
end end
describe 'DELETE #destroy' do describe 'DELETE #destroy' do
...@@ -252,8 +246,6 @@ describe GroupsController do ...@@ -252,8 +246,6 @@ describe GroupsController do
end end
end end
<<<<<<< HEAD
=======
describe '#ensure_canonical_path' do describe '#ensure_canonical_path' do
before do before do
sign_in(user) sign_in(user)
...@@ -447,7 +439,6 @@ describe GroupsController do ...@@ -447,7 +439,6 @@ describe GroupsController do
end end
end end
>>>>>>> origin/master
def group_moved_message(redirect_route, group) def group_moved_message(redirect_route, group)
"Group '#{redirect_route.path}' was moved to '#{group.full_path}'. Please update any links and bookmarks that may still have the old path." "Group '#{redirect_route.path}' was moved to '#{group.full_path}'. Please update any links and bookmarks that may still have the old path."
end end
......
...@@ -219,7 +219,6 @@ describe ProjectsController do ...@@ -219,7 +219,6 @@ describe ProjectsController do
expect(response).to redirect_to(namespace_project_path) expect(response).to redirect_to(namespace_project_path)
end end
end end
<<<<<<< HEAD
context 'when requesting a redirected path' do context 'when requesting a redirected path' do
let!(:redirect_route) { public_project.redirect_routes.create!(path: "foo/bar") } let!(:redirect_route) { public_project.redirect_routes.create!(path: "foo/bar") }
...@@ -231,8 +230,6 @@ describe ProjectsController do ...@@ -231,8 +230,6 @@ describe ProjectsController do
expect(controller).to set_flash[:notice].to(project_moved_message(redirect_route, public_project)) expect(controller).to set_flash[:notice].to(project_moved_message(redirect_route, public_project))
end end
end end
=======
>>>>>>> origin/master
end end
describe "#update" do describe "#update" do
...@@ -415,7 +412,6 @@ describe ProjectsController do ...@@ -415,7 +412,6 @@ describe ProjectsController do
expect(parsed_body["Tags"]).to include("v1.0.0") expect(parsed_body["Tags"]).to include("v1.0.0")
expect(parsed_body["Commits"]).to include("123456") expect(parsed_body["Commits"]).to include("123456")
end end
<<<<<<< HEAD
context 'when requesting a redirected path' do context 'when requesting a redirected path' do
let!(:redirect_route) { public_project.redirect_routes.create!(path: "foo/bar") } let!(:redirect_route) { public_project.redirect_routes.create!(path: "foo/bar") }
...@@ -427,8 +423,6 @@ describe ProjectsController do ...@@ -427,8 +423,6 @@ describe ProjectsController do
expect(controller).to set_flash[:notice].to(project_moved_message(redirect_route, public_project)) expect(controller).to set_flash[:notice].to(project_moved_message(redirect_route, public_project))
end end
end end
=======
>>>>>>> origin/master
end end
describe 'GET edit' do describe 'GET edit' do
...@@ -463,8 +457,6 @@ describe ProjectsController do ...@@ -463,8 +457,6 @@ describe ProjectsController do
end end
end end
<<<<<<< HEAD
=======
describe '#ensure_canonical_path' do describe '#ensure_canonical_path' do
before do before do
sign_in(user) sign_in(user)
...@@ -568,7 +560,6 @@ describe ProjectsController do ...@@ -568,7 +560,6 @@ describe ProjectsController do
end end
end end
>>>>>>> origin/master
def project_moved_message(redirect_route, project) def project_moved_message(redirect_route, project)
"Project '#{redirect_route.path}' was moved to '#{project.full_path}'. Please update any links and bookmarks that may still have the old path." "Project '#{redirect_route.path}' was moved to '#{project.full_path}'. Please update any links and bookmarks that may still have the old path."
end end
......
...@@ -53,7 +53,6 @@ describe UsersController do ...@@ -53,7 +53,6 @@ describe UsersController do
end end
end end
<<<<<<< HEAD
context 'when requesting the canonical path' do context 'when requesting the canonical path' do
let(:user) { create(:user, username: 'CamelCaseUser') } let(:user) { create(:user, username: 'CamelCaseUser') }
...@@ -88,8 +87,6 @@ describe UsersController do ...@@ -88,8 +87,6 @@ describe UsersController do
end end
end end
=======
>>>>>>> origin/master
context 'when a user by that username does not exist' do context 'when a user by that username does not exist' do
context 'when logged out' do context 'when logged out' do
it 'redirects to login page' do it 'redirects to login page' do
...@@ -134,7 +131,6 @@ describe UsersController do ...@@ -134,7 +131,6 @@ describe UsersController do
expect(assigns(:contributions_calendar).projects.count).to eq(2) expect(assigns(:contributions_calendar).projects.count).to eq(2)
end end
end end
<<<<<<< HEAD
context 'when requesting the canonical path' do context 'when requesting the canonical path' do
let(:user) { create(:user, username: 'CamelCaseUser') } let(:user) { create(:user, username: 'CamelCaseUser') }
...@@ -169,8 +165,6 @@ describe UsersController do ...@@ -169,8 +165,6 @@ describe UsersController do
expect(controller).to set_flash[:notice].to(user_moved_message(redirect_route, user)) expect(controller).to set_flash[:notice].to(user_moved_message(redirect_route, user))
end end
end end
=======
>>>>>>> origin/master
end end
describe 'GET #calendar_activities' do describe 'GET #calendar_activities' do
...@@ -193,7 +187,6 @@ describe UsersController do ...@@ -193,7 +187,6 @@ describe UsersController do
get :calendar_activities, username: user.username get :calendar_activities, username: user.username
expect(response).to render_template('calendar_activities') expect(response).to render_template('calendar_activities')
end end
<<<<<<< HEAD
context 'when requesting the canonical path' do context 'when requesting the canonical path' do
let(:user) { create(:user, username: 'CamelCaseUser') } let(:user) { create(:user, username: 'CamelCaseUser') }
...@@ -226,8 +219,6 @@ describe UsersController do ...@@ -226,8 +219,6 @@ describe UsersController do
expect(controller).to set_flash[:notice].to(user_moved_message(redirect_route, user)) expect(controller).to set_flash[:notice].to(user_moved_message(redirect_route, user))
end end
end end
=======
>>>>>>> origin/master
end end
describe 'GET #snippets' do describe 'GET #snippets' do
...@@ -250,7 +241,6 @@ describe UsersController do ...@@ -250,7 +241,6 @@ describe UsersController do
expect(JSON.parse(response.body)).to have_key('html') expect(JSON.parse(response.body)).to have_key('html')
end end
end end
<<<<<<< HEAD
context 'when requesting the canonical path' do context 'when requesting the canonical path' do
let(:user) { create(:user, username: 'CamelCaseUser') } let(:user) { create(:user, username: 'CamelCaseUser') }
...@@ -283,8 +273,6 @@ describe UsersController do ...@@ -283,8 +273,6 @@ describe UsersController do
expect(controller).to set_flash[:notice].to(user_moved_message(redirect_route, user)) expect(controller).to set_flash[:notice].to(user_moved_message(redirect_route, user))
end end
end end
=======
>>>>>>> origin/master
end end
describe 'GET #exists' do describe 'GET #exists' do
...@@ -333,8 +321,6 @@ describe UsersController do ...@@ -333,8 +321,6 @@ describe UsersController do
end end
end end
<<<<<<< HEAD
=======
describe '#ensure_canonical_path' do describe '#ensure_canonical_path' do
before do before do
sign_in(user) sign_in(user)
...@@ -456,7 +442,6 @@ describe UsersController do ...@@ -456,7 +442,6 @@ describe UsersController do
end end
end end
>>>>>>> origin/master
def user_moved_message(redirect_route, user) def user_moved_message(redirect_route, user)
"User '#{redirect_route.path}' was moved to '#{user.full_path}'. Please update any links and bookmarks that may still have the old path." "User '#{redirect_route.path}' was moved to '#{user.full_path}'. Please update any links and bookmarks that may still have the old path."
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