Commit a044bccb authored by James Lopez's avatar James Lopez

Refactor code and specs

parent 56813c7f
......@@ -8,7 +8,6 @@ class Groups::SamlProvidersController < Groups::ApplicationController
before_action :check_group_saml_available!
before_action :check_group_saml_configured
# rubocop: disable CodeReuse/ActiveRecord
def show
@saml_provider = @group.saml_provider || @group.build_saml_provider
......@@ -16,7 +15,6 @@ class Groups::SamlProvidersController < Groups::ApplicationController
@scim_token_url = scim_token.as_entity_json[:scim_api_url] if scim_token
end
# rubocop: enable CodeReuse/ActiveRecord
def create
@saml_provider = @group.build_saml_provider(saml_provider_params)
......
......@@ -5,7 +5,7 @@ class ScimOauthAccessToken < ApplicationRecord
belongs_to :group
add_authentication_token_field :token
add_authentication_token_field :token, encrypted: :required
validates :group, presence: true
before_save :ensure_token
......
# frozen_string_literal: true
require 'spec_helper'
describe Groups::ScimOauthController do
......
# Read about factories at https://github.com/thoughtbot/factory_bot
# frozen_string_literal: true
FactoryBot.define do
factory :scim_oauth_access_token do
......
# frozen_string_literal: true
require 'spec_helper'
describe ScimOauthAccessToken do
......
# frozen_string_literal: true
require 'spec_helper'
describe ScimOauthAccessTokenEntity 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