Make client name optional

This commit is contained in:
theworldbright 2015-08-29 09:19:07 -07:00
parent 9439a16d98
commit 4be9f4d558
2 changed files with 1 additions and 12 deletions

View file

@ -6,7 +6,7 @@ module Api
validates :client_id, presence: true, uniqueness: true
validates :client_secret, presence: true
validates :client_name, presence: true, uniqueness: {scope: :redirect_uris}
validates :client_name, uniqueness: {scope: :redirect_uris}
%i(redirect_uris response_types grant_types contacts).each do |serializable|
serialize serializable, JSON

View file

@ -24,17 +24,6 @@ describe Api::OpenidConnect::ClientsController, type: :controller do
expect(client_json["error"]).to have_content("invalid_client_metadata")
end
end
context "when redirect client_name is missing" do
it "should return a invalid_client_metadata error" do
post :create, redirect_uris: ["http://localhost"], response_types: [], grant_types: [],
application_type: "web", contacts: [], logo_uri: "http://example.com/logo.png",
client_uri: "http://example.com/client", policy_uri: "http://example.com/policy",
tos_uri: "http://example.com/tos"
client_json = JSON.parse(response.body)
expect(client_json["error"]).to have_content("invalid_client_metadata")
end
end
end
describe "#find" do