From 625dcd981e294564a0ac4ac0b5b9b02ff051fa3e Mon Sep 17 00:00:00 2001 From: jasl Date: Thu, 28 Mar 2019 00:13:08 +0800 Subject: [PATCH] rubocop -a --- Appraisals | 2 ++ Gemfile | 2 ++ bin/console | 1 + doorkeeper.gemspec | 2 ++ lib/doorkeeper/models/access_token_mixin.rb | 2 +- lib/doorkeeper/models/concerns/revocable.rb | 2 +- lib/doorkeeper/oauth.rb | 10 +++++----- lib/doorkeeper/oauth/authorization_code_request.rb | 2 +- lib/doorkeeper/oauth/client_credentials_request.rb | 2 +- lib/doorkeeper/oauth/helpers/uri_checker.rb | 1 + lib/doorkeeper/oauth/token.rb | 2 +- lib/doorkeeper/oauth/token_introspection.rb | 2 +- lib/doorkeeper/orm/active_record/access_grant.rb | 2 +- lib/doorkeeper/orm/active_record/access_token.rb | 2 +- lib/doorkeeper/rails/helpers.rb | 2 +- lib/doorkeeper/stale_records_cleaner.rb | 2 +- spec/dummy/Rakefile | 2 ++ spec/dummy/app/controllers/application_controller.rb | 2 ++ .../controllers/custom_authorizations_controller.rb | 2 ++ .../controllers/full_protected_resources_controller.rb | 2 ++ spec/dummy/app/controllers/home_controller.rb | 2 ++ spec/dummy/app/controllers/metal_controller.rb | 2 ++ .../controllers/semi_protected_resources_controller.rb | 2 ++ spec/dummy/app/helpers/application_helper.rb | 2 ++ spec/dummy/app/models/user.rb | 2 ++ spec/dummy/config.ru | 2 ++ spec/dummy/config/environments/development.rb | 2 ++ spec/dummy/config/environments/production.rb | 2 ++ spec/dummy/config/environments/test.rb | 2 ++ spec/dummy/config/initializers/backtrace_silencers.rb | 2 ++ spec/dummy/config/initializers/secret_token.rb | 2 ++ spec/dummy/config/initializers/session_store.rb | 2 ++ spec/dummy/config/initializers/wrap_parameters.rb | 2 ++ spec/dummy/db/migrate/20170822064514_enable_pkce.rb | 2 ++ spec/dummy/script/rails | 2 ++ spec/generators/templates/routes.rb | 2 ++ spec/routing/custom_controller_routes_spec.rb | 2 ++ spec/routing/default_routes_spec.rb | 2 ++ spec/routing/scoped_routes_spec.rb | 2 ++ spec/support/dependencies/factory_bot.rb | 2 ++ spec/support/doorkeeper_rspec.rb | 2 ++ spec/support/helpers/access_token_request_helper.rb | 2 ++ spec/support/helpers/authorization_request_helper.rb | 2 ++ spec/support/helpers/config_helper.rb | 2 ++ spec/support/helpers/model_helper.rb | 2 ++ spec/support/helpers/request_spec_helper.rb | 2 ++ spec/support/helpers/url_helper.rb | 2 ++ spec/support/http_method_shim.rb | 2 ++ spec/support/orm/active_record.rb | 2 ++ spec/support/shared/controllers_shared_context.rb | 2 ++ spec/support/shared/models_shared_examples.rb | 2 ++ spec/validators/redirect_uri_validator_spec.rb | 2 ++ 52 files changed, 95 insertions(+), 15 deletions(-) diff --git a/Appraisals b/Appraisals index 3400b764e..3a049a702 100644 --- a/Appraisals +++ b/Appraisals @@ -1,3 +1,5 @@ +# frozen_string_literal: true + appraise "rails-5-0" do gem "rails", "~> 5.0.0" gem "sqlite3", "~> 1.3", "< 1.4", platform: %i[ruby mswin mingw x64_mingw] diff --git a/Gemfile b/Gemfile index 94218dbd6..e29bbbdb9 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + source "https://rubygems.org" git_source(:github) { |repo| "https://github.com/#{repo}.git" } diff --git a/bin/console b/bin/console index 71b81755b..7f1d2cef3 100755 --- a/bin/console +++ b/bin/console @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true require "bundler/setup" require "rails/all" diff --git a/doorkeeper.gemspec b/doorkeeper.gemspec index db844400a..e9f4ee669 100644 --- a/doorkeeper.gemspec +++ b/doorkeeper.gemspec @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.push File.expand_path("lib", __dir__) require "doorkeeper/version" diff --git a/lib/doorkeeper/models/access_token_mixin.rb b/lib/doorkeeper/models/access_token_mixin.rb index 06d0d1479..a9fcad6d9 100644 --- a/lib/doorkeeper/models/access_token_mixin.rb +++ b/lib/doorkeeper/models/access_token_mixin.rb @@ -127,7 +127,7 @@ def find_or_create_for(application, resource_owner_id, scopes, expires_in, use_r if Doorkeeper.configuration.reuse_access_token access_token = matching_token_for(application, resource_owner_id, scopes) - return access_token if access_token && access_token.reusable? + return access_token if access_token&.reusable? end create!( diff --git a/lib/doorkeeper/models/concerns/revocable.rb b/lib/doorkeeper/models/concerns/revocable.rb index 996e3da43..9adde673d 100644 --- a/lib/doorkeeper/models/concerns/revocable.rb +++ b/lib/doorkeeper/models/concerns/revocable.rb @@ -26,7 +26,7 @@ def revoked? def revoke_previous_refresh_token! return unless refresh_token_revoked_on_use? - old_refresh_token.revoke if old_refresh_token + old_refresh_token&.revoke update_attribute :previous_refresh_token, "" end diff --git a/lib/doorkeeper/oauth.rb b/lib/doorkeeper/oauth.rb index d8bd1b218..256ac2cb6 100644 --- a/lib/doorkeeper/oauth.rb +++ b/lib/doorkeeper/oauth.rb @@ -3,11 +3,11 @@ module Doorkeeper module OAuth GRANT_TYPES = [ - AUTHORIZATION_CODE = "authorization_code".freeze, - IMPLICIT = "implicit".freeze, - PASSWORD = "password".freeze, - CLIENT_CREDENTIALS = "client_credentials".freeze, - REFRESH_TOKEN = "refresh_token".freeze, + AUTHORIZATION_CODE = "authorization_code", + IMPLICIT = "implicit", + PASSWORD = "password", + CLIENT_CREDENTIALS = "client_credentials", + REFRESH_TOKEN = "refresh_token", ].freeze end end diff --git a/lib/doorkeeper/oauth/authorization_code_request.rb b/lib/doorkeeper/oauth/authorization_code_request.rb index 57a6b824d..732c65deb 100644 --- a/lib/doorkeeper/oauth/authorization_code_request.rb +++ b/lib/doorkeeper/oauth/authorization_code_request.rb @@ -43,7 +43,7 @@ def before_successful_response end def validate_attributes - return false if grant && grant.uses_pkce? && code_verifier.blank? + return false if grant&.uses_pkce? && code_verifier.blank? return false if grant && !grant.pkce_supported? && !code_verifier.blank? redirect_uri.present? diff --git a/lib/doorkeeper/oauth/client_credentials_request.rb b/lib/doorkeeper/oauth/client_credentials_request.rb index 05422b078..65849c22a 100644 --- a/lib/doorkeeper/oauth/client_credentials_request.rb +++ b/lib/doorkeeper/oauth/client_credentials_request.rb @@ -7,7 +7,7 @@ class ClientCredentialsRequest < BaseRequest attr_reader :response attr_writer :issuer - alias_method :error_response, :response + alias error_response response delegate :error, to: :issuer diff --git a/lib/doorkeeper/oauth/helpers/uri_checker.rb b/lib/doorkeeper/oauth/helpers/uri_checker.rb index 6c4fd8ffc..c0e90e928 100644 --- a/lib/doorkeeper/oauth/helpers/uri_checker.rb +++ b/lib/doorkeeper/oauth/helpers/uri_checker.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require "ipaddr" module Doorkeeper diff --git a/lib/doorkeeper/oauth/token.rb b/lib/doorkeeper/oauth/token.rb index 92be256cc..2ff6a7685 100644 --- a/lib/doorkeeper/oauth/token.rb +++ b/lib/doorkeeper/oauth/token.rb @@ -59,7 +59,7 @@ def token_from_header(header, pattern) end def match?(header, pattern) - header && header.match(pattern) + header&.match(pattern) end end end diff --git a/lib/doorkeeper/oauth/token_introspection.rb b/lib/doorkeeper/oauth/token_introspection.rb index d57229f7e..12b08e44f 100644 --- a/lib/doorkeeper/oauth/token_introspection.rb +++ b/lib/doorkeeper/oauth/token_introspection.rb @@ -158,7 +158,7 @@ def active? # Token can be valid only if it is not expired or revoked. def valid_token? - @token && @token.accessible? + @token&.accessible? end # RFC7662 Section 2.1 diff --git a/lib/doorkeeper/orm/active_record/access_grant.rb b/lib/doorkeeper/orm/active_record/access_grant.rb index dffa9b3db..e1574c7e1 100644 --- a/lib/doorkeeper/orm/active_record/access_grant.rb +++ b/lib/doorkeeper/orm/active_record/access_grant.rb @@ -7,7 +7,7 @@ class AccessGrant < ActiveRecord::Base include AccessGrantMixin belongs_to :application, class_name: "Doorkeeper::Application", - optional: true, inverse_of: :access_grants + optional: true, inverse_of: :access_grants validates :resource_owner_id, :application_id, diff --git a/lib/doorkeeper/orm/active_record/access_token.rb b/lib/doorkeeper/orm/active_record/access_token.rb index 6c683bf45..ed8388ead 100644 --- a/lib/doorkeeper/orm/active_record/access_token.rb +++ b/lib/doorkeeper/orm/active_record/access_token.rb @@ -7,7 +7,7 @@ class AccessToken < ActiveRecord::Base include AccessTokenMixin belongs_to :application, class_name: "Doorkeeper::Application", - inverse_of: :access_tokens, optional: true + inverse_of: :access_tokens, optional: true validates :token, presence: true, uniqueness: true validates :refresh_token, uniqueness: true, if: :use_refresh_token? diff --git a/lib/doorkeeper/rails/helpers.rb b/lib/doorkeeper/rails/helpers.rb index 70c9b0148..101b6653c 100644 --- a/lib/doorkeeper/rails/helpers.rb +++ b/lib/doorkeeper/rails/helpers.rb @@ -14,7 +14,7 @@ def doorkeeper_unauthorized_render_options(**); end def doorkeeper_forbidden_render_options(**); end def valid_doorkeeper_token? - doorkeeper_token && doorkeeper_token.acceptable?(@_doorkeeper_scopes) + doorkeeper_token&.acceptable?(@_doorkeeper_scopes) end private diff --git a/lib/doorkeeper/stale_records_cleaner.rb b/lib/doorkeeper/stale_records_cleaner.rb index 771531176..14560ca1d 100644 --- a/lib/doorkeeper/stale_records_cleaner.rb +++ b/lib/doorkeeper/stale_records_cleaner.rb @@ -2,7 +2,7 @@ module Doorkeeper class StaleRecordsCleaner - CLEANER_CLASS = "StaleRecordsCleaner".freeze + CLEANER_CLASS = "StaleRecordsCleaner" def self.for(base_scope) orm_adapter = "doorkeeper/orm/#{Doorkeeper.configuration.orm}".classify diff --git a/spec/dummy/Rakefile b/spec/dummy/Rakefile index c38685fa1..9a26012b1 100755 --- a/spec/dummy/Rakefile +++ b/spec/dummy/Rakefile @@ -1,4 +1,6 @@ #!/usr/bin/env rake +# frozen_string_literal: true + # Add your own tasks in files placed in lib/tasks ending in .rake, # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. diff --git a/spec/dummy/app/controllers/application_controller.rb b/spec/dummy/app/controllers/application_controller.rb index 1c07694e9..280cc28ce 100644 --- a/spec/dummy/app/controllers/application_controller.rb +++ b/spec/dummy/app/controllers/application_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ApplicationController < ActionController::Base protect_from_forgery with: :exception end diff --git a/spec/dummy/app/controllers/custom_authorizations_controller.rb b/spec/dummy/app/controllers/custom_authorizations_controller.rb index 467e26eb2..154f5589f 100644 --- a/spec/dummy/app/controllers/custom_authorizations_controller.rb +++ b/spec/dummy/app/controllers/custom_authorizations_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CustomAuthorizationsController < ::ApplicationController %w[index show new create edit update destroy].each do |action| define_method action do diff --git a/spec/dummy/app/controllers/full_protected_resources_controller.rb b/spec/dummy/app/controllers/full_protected_resources_controller.rb index 5dc68ba2c..3a358f2c3 100644 --- a/spec/dummy/app/controllers/full_protected_resources_controller.rb +++ b/spec/dummy/app/controllers/full_protected_resources_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class FullProtectedResourcesController < ApplicationController before_action -> { doorkeeper_authorize! :write, :admin }, only: :show before_action :doorkeeper_authorize!, only: :index diff --git a/spec/dummy/app/controllers/home_controller.rb b/spec/dummy/app/controllers/home_controller.rb index b26333faf..39f2bcd3f 100644 --- a/spec/dummy/app/controllers/home_controller.rb +++ b/spec/dummy/app/controllers/home_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class HomeController < ApplicationController def index; end diff --git a/spec/dummy/app/controllers/metal_controller.rb b/spec/dummy/app/controllers/metal_controller.rb index 83574feb1..c6ef30785 100644 --- a/spec/dummy/app/controllers/metal_controller.rb +++ b/spec/dummy/app/controllers/metal_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class MetalController < ActionController::Metal include AbstractController::Callbacks include ActionController::Head diff --git a/spec/dummy/app/controllers/semi_protected_resources_controller.rb b/spec/dummy/app/controllers/semi_protected_resources_controller.rb index 05cb0d498..7b964a6b8 100644 --- a/spec/dummy/app/controllers/semi_protected_resources_controller.rb +++ b/spec/dummy/app/controllers/semi_protected_resources_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class SemiProtectedResourcesController < ApplicationController before_action :doorkeeper_authorize!, only: :index diff --git a/spec/dummy/app/helpers/application_helper.rb b/spec/dummy/app/helpers/application_helper.rb index 2dbb236e4..5e653d435 100644 --- a/spec/dummy/app/helpers/application_helper.rb +++ b/spec/dummy/app/helpers/application_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ApplicationHelper def current_user @current_user ||= User.find_by_id(session[:user_id]) diff --git a/spec/dummy/app/models/user.rb b/spec/dummy/app/models/user.rb index bb337d7c8..53124f5cc 100644 --- a/spec/dummy/app/models/user.rb +++ b/spec/dummy/app/models/user.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class User < ActiveRecord::Base def self.authenticate!(name, password) User.where(name: name, password: password).first diff --git a/spec/dummy/config.ru b/spec/dummy/config.ru index 08dd501dd..bfec9a4df 100644 --- a/spec/dummy/config.ru +++ b/spec/dummy/config.ru @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This file is used by Rack-based servers to start the application. require ::File.expand_path("../config/environment", __FILE__) diff --git a/spec/dummy/config/environments/development.rb b/spec/dummy/config/environments/development.rb index df00f8a83..0702a8b12 100644 --- a/spec/dummy/config/environments/development.rb +++ b/spec/dummy/config/environments/development.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + Dummy::Application.configure do # Settings specified here will take precedence over those in config/application.rb diff --git a/spec/dummy/config/environments/production.rb b/spec/dummy/config/environments/production.rb index 5c1874089..5365afb9d 100644 --- a/spec/dummy/config/environments/production.rb +++ b/spec/dummy/config/environments/production.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + Dummy::Application.configure do # Settings specified here will take precedence over those in config/application.rb diff --git a/spec/dummy/config/environments/test.rb b/spec/dummy/config/environments/test.rb index 31852542a..b184dff9f 100644 --- a/spec/dummy/config/environments/test.rb +++ b/spec/dummy/config/environments/test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + Dummy::Application.configure do # Settings specified here will take precedence over those in config/application.rb diff --git a/spec/dummy/config/initializers/backtrace_silencers.rb b/spec/dummy/config/initializers/backtrace_silencers.rb index 59385cdf3..4b63f2893 100644 --- a/spec/dummy/config/initializers/backtrace_silencers.rb +++ b/spec/dummy/config/initializers/backtrace_silencers.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Be sure to restart your server when you modify this file. # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. diff --git a/spec/dummy/config/initializers/secret_token.rb b/spec/dummy/config/initializers/secret_token.rb index cd2b4f8c2..eb52ed247 100644 --- a/spec/dummy/config/initializers/secret_token.rb +++ b/spec/dummy/config/initializers/secret_token.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Be sure to restart your server when you modify this file. # Your secret key for verifying the integrity of signed cookies. diff --git a/spec/dummy/config/initializers/session_store.rb b/spec/dummy/config/initializers/session_store.rb index 7fef319f4..2328438f1 100644 --- a/spec/dummy/config/initializers/session_store.rb +++ b/spec/dummy/config/initializers/session_store.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Be sure to restart your server when you modify this file. Dummy::Application.config.session_store :cookie_store, key: "_dummy_session" diff --git a/spec/dummy/config/initializers/wrap_parameters.rb b/spec/dummy/config/initializers/wrap_parameters.rb index 999df2018..85b2d8406 100644 --- a/spec/dummy/config/initializers/wrap_parameters.rb +++ b/spec/dummy/config/initializers/wrap_parameters.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Be sure to restart your server when you modify this file. # # This file contains settings for ActionController::ParamsWrapper which diff --git a/spec/dummy/db/migrate/20170822064514_enable_pkce.rb b/spec/dummy/db/migrate/20170822064514_enable_pkce.rb index 586ad1cec..601578649 100644 --- a/spec/dummy/db/migrate/20170822064514_enable_pkce.rb +++ b/spec/dummy/db/migrate/20170822064514_enable_pkce.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class EnablePkce < ActiveRecord::Migration[4.2] def change add_column :oauth_access_grants, :code_challenge, :string, null: true diff --git a/spec/dummy/script/rails b/spec/dummy/script/rails index 7ca7f5daf..ae2b250ee 100755 --- a/spec/dummy/script/rails +++ b/spec/dummy/script/rails @@ -1,4 +1,6 @@ #!/usr/bin/env ruby +# frozen_string_literal: true + # This command will automatically be run when you run "rails" with Rails 3 gems # installed from the root of your application. diff --git a/spec/generators/templates/routes.rb b/spec/generators/templates/routes.rb index 1daf9a412..edf04d2d6 100644 --- a/spec/generators/templates/routes.rb +++ b/spec/generators/templates/routes.rb @@ -1,2 +1,4 @@ +# frozen_string_literal: true + Rails.application.routes.draw do end diff --git a/spec/routing/custom_controller_routes_spec.rb b/spec/routing/custom_controller_routes_spec.rb index fba95bbde..6a5edb974 100644 --- a/spec/routing/custom_controller_routes_spec.rb +++ b/spec/routing/custom_controller_routes_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" describe "Custom controller for routes" do diff --git a/spec/routing/default_routes_spec.rb b/spec/routing/default_routes_spec.rb index 81d0f60a2..06d232a66 100644 --- a/spec/routing/default_routes_spec.rb +++ b/spec/routing/default_routes_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" describe "Default routes" do diff --git a/spec/routing/scoped_routes_spec.rb b/spec/routing/scoped_routes_spec.rb index a7df15e1d..63f02a0ad 100644 --- a/spec/routing/scoped_routes_spec.rb +++ b/spec/routing/scoped_routes_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" describe "Scoped routes" do diff --git a/spec/support/dependencies/factory_bot.rb b/spec/support/dependencies/factory_bot.rb index 9b1a5cadb..ed03a3aa1 100644 --- a/spec/support/dependencies/factory_bot.rb +++ b/spec/support/dependencies/factory_bot.rb @@ -1,2 +1,4 @@ +# frozen_string_literal: true + require "factory_bot" FactoryBot.find_definitions diff --git a/spec/support/doorkeeper_rspec.rb b/spec/support/doorkeeper_rspec.rb index 210b4ddfa..8337bc29b 100644 --- a/spec/support/doorkeeper_rspec.rb +++ b/spec/support/doorkeeper_rspec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Doorkeeper class RSpec # Print's useful information about env: Ruby / Rails versions, diff --git a/spec/support/helpers/access_token_request_helper.rb b/spec/support/helpers/access_token_request_helper.rb index e76d111b5..15af9db33 100644 --- a/spec/support/helpers/access_token_request_helper.rb +++ b/spec/support/helpers/access_token_request_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module AccessTokenRequestHelper def client_is_authorized(client, resource_owner, access_token_attributes = {}) attributes = { diff --git a/spec/support/helpers/authorization_request_helper.rb b/spec/support/helpers/authorization_request_helper.rb index 2b5be6760..e4e888f7c 100644 --- a/spec/support/helpers/authorization_request_helper.rb +++ b/spec/support/helpers/authorization_request_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module AuthorizationRequestHelper def resource_owner_is_authenticated(resource_owner = nil) resource_owner ||= User.create!(name: "Joe", password: "sekret") diff --git a/spec/support/helpers/config_helper.rb b/spec/support/helpers/config_helper.rb index 654f6234f..6c86e53be 100644 --- a/spec/support/helpers/config_helper.rb +++ b/spec/support/helpers/config_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ConfigHelper def config_is_set(setting, value = nil, &block) setting_ivar = "@#{setting}" diff --git a/spec/support/helpers/model_helper.rb b/spec/support/helpers/model_helper.rb index 146edc73c..c9ee9a45d 100644 --- a/spec/support/helpers/model_helper.rb +++ b/spec/support/helpers/model_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ModelHelper def client_exists(client_attributes = {}) @client = FactoryBot.create(:application, client_attributes) diff --git a/spec/support/helpers/request_spec_helper.rb b/spec/support/helpers/request_spec_helper.rb index bcfdb4ea0..5f70c5b54 100644 --- a/spec/support/helpers/request_spec_helper.rb +++ b/spec/support/helpers/request_spec_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module RequestSpecHelper def i_am_logged_in allow(Doorkeeper.configuration).to receive(:authenticate_admin).and_return(->(*) {}) diff --git a/spec/support/helpers/url_helper.rb b/spec/support/helpers/url_helper.rb index 6ab85e62b..01ad30d31 100644 --- a/spec/support/helpers/url_helper.rb +++ b/spec/support/helpers/url_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module UrlHelper def token_endpoint_url(options = {}) parameters = { diff --git a/spec/support/http_method_shim.rb b/spec/support/http_method_shim.rb index fc65aca3c..0089342fd 100644 --- a/spec/support/http_method_shim.rb +++ b/spec/support/http_method_shim.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Rails 5 deprecates calling HTTP action methods with positional arguments # in favor of keyword arguments. However, the keyword argument form is only # supported in Rails 5+. Since we support back to 4, we need some sort of shim diff --git a/spec/support/orm/active_record.rb b/spec/support/orm/active_record.rb index b73026e6d..1795b0515 100644 --- a/spec/support/orm/active_record.rb +++ b/spec/support/orm/active_record.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # load schema to in memory sqlite ActiveRecord::Migration.verbose = false load Rails.root + "db/schema.rb" diff --git a/spec/support/shared/controllers_shared_context.rb b/spec/support/shared/controllers_shared_context.rb index 83e8987e0..ef322ff28 100644 --- a/spec/support/shared/controllers_shared_context.rb +++ b/spec/support/shared/controllers_shared_context.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + shared_context "valid token", token: :valid do let(:token_string) { "1A2B3C4D" } diff --git a/spec/support/shared/models_shared_examples.rb b/spec/support/shared/models_shared_examples.rb index b0597fd62..8e00d9a53 100644 --- a/spec/support/shared/models_shared_examples.rb +++ b/spec/support/shared/models_shared_examples.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + shared_examples "an accessible token" do describe :accessible? do it "is accessible if token is not expired" do diff --git a/spec/validators/redirect_uri_validator_spec.rb b/spec/validators/redirect_uri_validator_spec.rb index 6a27baeb9..44093239b 100644 --- a/spec/validators/redirect_uri_validator_spec.rb +++ b/spec/validators/redirect_uri_validator_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" describe RedirectUriValidator do