Fix failing auth code test and styles

This commit is contained in:
theworldbright 2015-08-28 15:51:10 -07:00
parent 8c2af74447
commit 9439a16d98
6 changed files with 15 additions and 16 deletions

View file

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

View file

@ -1,9 +1,9 @@
#settings_nav
%h2= t('settings')
%h2= t("settings")
%nav
%ul
%li= link_to_unless_current t('profile'), edit_profile_path
%li= link_to_unless_current t('account'), edit_user_path
%li= link_to_unless_current t('privacy'), privacy_settings_path
%li= link_to_unless_current t('_services'), services_path
%li= link_to_unless_current t('_applications'), api_openid_connect_user_applications_path
%li= link_to_unless_current t("profile"), edit_profile_path
%li= link_to_unless_current t("account"), edit_user_path
%li= link_to_unless_current t("privacy"), privacy_settings_path
%li= link_to_unless_current t("_services"), services_path
%li= link_to_unless_current t("_applications"), api_openid_connect_user_applications_path

View file

@ -1,4 +1,4 @@
O_AUTH_QUERY_PARAMS = {
O_AUTH_QUERY_PARAMS_WITH_CODE = {
redirect_uri: "http://localhost:3000",
response_type: "code",
scope: "openid read",
@ -10,12 +10,12 @@ Given /^I send a post request from that client to the code flow authorization en
client_json = JSON.parse(last_response.body)
@client_id = client_json["client_id"]
@client_secret = client_json["client_secret"]
params = O_AUTH_QUERY_PARAMS.merge(client_id: @client_id)
params = O_AUTH_QUERY_PARAMS_WITH_CODE.merge(client_id: @client_id)
visit new_api_openid_connect_authorization_path(params)
end
Given /^I send a post request from that client to the code flow authorization endpoint using a invalid client id/ do
params = O_AUTH_QUERY_PARAMS.merge(client_id: "randomid")
params = O_AUTH_QUERY_PARAMS_WITH_CODE.merge(client_id: "randomid")
visit new_api_openid_connect_authorization_path(params)
end