Merge branch 'username-keys-content-type' of https://github.com/dmedvinsky/gitlabhq into dmedvinsky-username-keys-content-type

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>

Conflicts:
	CHANGELOG
This commit is contained in:
Dmitriy Zaporozhets 2014-03-21 09:37:03 +02:00
commit ac35ee3707
No known key found for this signature in database
GPG Key ID: 627C5F589F467F17
3 changed files with 12 additions and 1 deletions

View File

@ -30,6 +30,7 @@ v 6.7.0
- Requires at least 2 unicorn workers
- Requires gitlab-shell v1.9+
- Replaced gemoji(due to closed licencing problem) with Phantom Open Emoji library(combined SIL Open Font License, MIT License and the CC 3.0 License)
- Fix `/:username.keys` response content type (Dmitry Medvinsky)
v 6.6.5
- Added option to remove issue assignee on project issue page and issue edit page (Jason Blanchard)

View File

@ -41,7 +41,7 @@ class Profiles::KeysController < ApplicationController
begin
user = User.find_by_username(params[:username])
if user.present?
render text: user.all_ssh_keys.join("\n")
render text: user.all_ssh_keys.join("\n"), content_type: "text/plain"
else
render_404 and return
end

View File

@ -24,6 +24,11 @@ describe Profiles::KeysController do
expect(response.body).to eq("")
end
it "should respond with text/plain content type" do
get :get_keys, username: user.username
expect(response.content_type).to eq("text/plain")
end
end
describe "user with keys" do
@ -44,6 +49,11 @@ describe Profiles::KeysController do
expect(response.body).not_to eq("")
expect(response.body).to eq(user.all_ssh_keys.join("\n"))
end
it "should respond with text/plain content type" do
get :get_keys, username: user.username
expect(response.content_type).to eq("text/plain")
end
end
end
end