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