Commit ddec8e77 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'fix-redirect-profile-keys-new-to-profile-keys' into 'master'

Make /profile/keys/new redirects to /profile/keys for back-compat

This addresses https://github.com/gitlabhq/gitlabhq/issues/10138.

See merge request !3717
parents 4e2f068c a434ffd3
......@@ -18,6 +18,7 @@ v 8.7.0 (unreleased)
- Don't attempt to look up an avatar in repo if repo directory does not exist (Stan Hu)
- API: Ability to subscribe and unsubscribe from issues and merge requests (Robert Schilling)
- Expose project badges in project settings
- Make /profile/keys/new redirect to /profile/keys for back-compat. !3717
- Preserve time notes/comments have been updated at when moving issue
- Make HTTP(s) label consistent on clone bar (Stan Hu)
- Expose label description in API (Mariusz Jachimowicz)
......
......@@ -10,6 +10,11 @@ class Profiles::KeysController < Profiles::ApplicationController
@key = current_user.keys.find(params[:id])
end
# Back-compat: We need to support this URL since git-annex webapp points to it
def new
redirect_to profile_keys_path
end
def create
@key = current_user.keys.new(key_params)
......
......@@ -328,7 +328,7 @@ Rails.application.routes.draw do
end
end
resource :preferences, only: [:show, :update]
resources :keys, except: [:new]
resources :keys
resources :emails, only: [:index, :create, :destroy]
resource :avatar, only: [:destroy]
resource :two_factor_auth, only: [:new, :create, :destroy] do
......
......@@ -3,6 +3,16 @@ require 'spec_helper'
describe Profiles::KeysController do
let(:user) { create(:user) }
describe '#new' do
before { sign_in(user) }
it 'redirect to #index' do
get :new
expect(response).to redirect_to(profile_keys_path)
end
end
describe "#get_keys" do
describe "non existant user" do
it "should generally not work" do
......
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