From b19734d18bf978120e8d2a4ca079946cbeeff468 Mon Sep 17 00:00:00 2001 From: Alex Kotov Date: Sun, 28 Apr 2019 18:34:46 +0500 Subject: [PATCH] Fix code style --- .rubocop.yml | 3 --- app/controllers/application_controller.rb | 4 ++-- .../passport_confirmations_controller.rb | 2 +- .../users/omniauth_callbacks_controller.rb | 4 ++-- app/helpers/application_helper.rb | 2 +- .../authenticate_user_with_omniauth.rb | 2 +- app/mailers/membership_app_mailer.rb | 2 +- app/models/account.rb | 10 ++++----- app/models/person.rb | 4 ++-- app/models/relationship.rb | 6 ++--- app/models/role.rb | 8 +++---- config/boot.rb | 12 +++++----- config/environments/production.rb | 6 ++--- .../action_mailer_smtp_settings.rb | 14 ++++++------ config/initializers/sidekiq.rb | 12 +++++----- config/initializers/simple_form_bootstrap.rb | 14 ++++++------ config/routes.rb | 16 +++++++------- ...te_active_storage_tables.active_storage.rb | 2 +- .../20181202022901_add_account_to_users.rb | 4 ++-- ..._add_account_to_membership_applications.rb | 2 +- .../20181202140310_create_passport_maps.rb | 2 +- ...4_non_unique_passport_for_passport_maps.rb | 6 ++--- ...81206194527_create_membership_pool_apps.rb | 2 +- ...6205529_create_membership_pool_accounts.rb | 2 +- .../20181206224446_create_regional_offices.rb | 4 ++-- ...81210024922_add_guest_token_to_accounts.rb | 2 +- ...000903_create_account_telegram_contacts.rb | 6 ++--- ...90201012021_unique_username_of_accounts.rb | 2 +- db/seeds.rb | 4 ++-- factories/passports.rb | 2 +- features/step_definitions/account.rb | 22 +++++++++---------- spec/interactors/confirm_passport_spec.rb | 12 +++++----- spec/requests/membership_apps/create_spec.rb | 4 ++-- spec/requests/settings/profile/update_spec.rb | 4 ++-- .../passport_confirmations/create_spec.rb | 6 ++--- spec/requests/users/create_spec.rb | 2 +- 36 files changed, 104 insertions(+), 107 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index a34f68f..61ae206 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -15,9 +15,6 @@ AllCops: Layout/AccessModifierIndentation: EnforcedStyle: outdent -Layout/AlignHash: - EnforcedColonStyle: table - Layout/EmptyLinesAroundArguments: Enabled: false diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 06b30fa..17869b2 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -28,7 +28,7 @@ private def set_raven_context Raven.user_context( account_id: current_account&.id, - user_id: current_user&.id, + user_id: current_user&.id, ) Raven.extra_context params: params.to_unsafe_h, url: request.url @@ -63,7 +63,7 @@ private def render_method_not_allowed respond_to do |format| format.html do - render status: :method_not_allowed, + render status: :method_not_allowed, template: 'errors/method_not_allowed' end format.json { render status: :method_not_allowed, json: {} } diff --git a/app/controllers/staffs/passports/passport_confirmations_controller.rb b/app/controllers/staffs/passports/passport_confirmations_controller.rb index 9f1826b..de66908 100644 --- a/app/controllers/staffs/passports/passport_confirmations_controller.rb +++ b/app/controllers/staffs/passports/passport_confirmations_controller.rb @@ -17,7 +17,7 @@ class Staffs::Passports::PassportConfirmationsController < ApplicationController def create ActiveRecord::Base.transaction do ConfirmPassport.call(passport: @passport, - account: current_account).tap do |context| + account: current_account).tap do |context| authorize_if_present context.passport_confirmation end end diff --git a/app/controllers/users/omniauth_callbacks_controller.rb b/app/controllers/users/omniauth_callbacks_controller.rb index f8b63cc..eefdf4a 100644 --- a/app/controllers/users/omniauth_callbacks_controller.rb +++ b/app/controllers/users/omniauth_callbacks_controller.rb @@ -17,9 +17,9 @@ class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController # GET|POST /users/auth/github/callback def github context = AuthenticateUserWithOmniauth.call( - provider: auth_hash.provider, + provider: auth_hash.provider, remote_id: auth_hash.uid, - email: auth_hash.info.email, + email: auth_hash.info.email, ) sign_in_and_redirect context.user diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index dc9687c..ac98573 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -2,7 +2,7 @@ module ApplicationHelper NAV_TABS_LIST_HTML_CLASS = { - tabs: 'nav nav-tabs d-none d-sm-flex', + tabs: 'nav nav-tabs d-none d-sm-flex', pills: 'nav nav-pills d-flex d-sm-none flex-column', }.freeze diff --git a/app/interactors/authenticate_user_with_omniauth.rb b/app/interactors/authenticate_user_with_omniauth.rb index 354340c..37c00a3 100644 --- a/app/interactors/authenticate_user_with_omniauth.rb +++ b/app/interactors/authenticate_user_with_omniauth.rb @@ -33,7 +33,7 @@ private def build_user_omniauth context.user_omniauth = UserOmniauth.where( - provider: context.provider, + provider: context.provider, remote_id: context.remote_id, ).lock(true).first_or_initialize do |new_user_omniauth| new_user_omniauth.user = context.user diff --git a/app/mailers/membership_app_mailer.rb b/app/mailers/membership_app_mailer.rb index 335a89e..1607196 100644 --- a/app/mailers/membership_app_mailer.rb +++ b/app/mailers/membership_app_mailer.rb @@ -5,7 +5,7 @@ class MembershipAppMailer < ApplicationMailer def tracking mail( - to: @membership_app.email, + to: @membership_app.email, subject: translate('membership_app_mailer.tracking.subject'), ) end diff --git a/app/models/account.rb b/app/models/account.rb index 515f91f..460690f 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -27,7 +27,7 @@ class Account < ApplicationRecord has_many :account_roles, -> { active }, inverse_of: :account, - dependent: :restrict_with_exception + dependent: :restrict_with_exception has_many :roles, through: :account_roles @@ -37,7 +37,7 @@ class Account < ApplicationRecord has_one :own_membership_app, class_name: 'MembershipApp', - dependent: :restrict_with_exception + dependent: :restrict_with_exception has_many :passport_confirmations, dependent: :restrict_with_exception @@ -59,9 +59,9 @@ class Account < ApplicationRecord validates :person, allow_nil: true, uniqueness: true validates :nickname, - presence: true, - length: { in: 3..36 }, - format: NICKNAME_RE, + presence: true, + length: { in: 3..36 }, + format: NICKNAME_RE, uniqueness: { case_sensitive: false } validates :public_name, allow_nil: true, length: { in: 3..255 } diff --git a/app/models/person.rb b/app/models/person.rb index 8f0fdaf..9b05952 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -20,8 +20,8 @@ class Person < ApplicationRecord has_one :own_membership_app, class_name: 'MembershipApp', inverse_of: :person, - through: :account, - source: :own_membership_app + through: :account, + source: :own_membership_app ############### # Validations # diff --git a/app/models/relationship.rb b/app/models/relationship.rb index 8b8d5bd..6fbcf9c 100644 --- a/app/models/relationship.rb +++ b/app/models/relationship.rb @@ -13,10 +13,10 @@ class Relationship < ApplicationRecord ############### validates :number, - presence: true, - uniqueness: { scope: :person_id }, + presence: true, + uniqueness: { scope: :person_id }, numericality: { - only_integer: true, + only_integer: true, greater_than_or_equal_to: 0, } diff --git a/app/models/role.rb b/app/models/role.rb index 19c36d7..e40f2f0 100644 --- a/app/models/role.rb +++ b/app/models/role.rb @@ -14,7 +14,7 @@ class Role < ApplicationRecord has_many :account_roles, -> { active }, inverse_of: :role, - dependent: :restrict_with_exception + dependent: :restrict_with_exception has_many :accounts, through: :account_roles @@ -25,7 +25,7 @@ class Role < ApplicationRecord ############### validates :name, - presence: true, + presence: true, inclusion: { in: NAMES } validates :resource_type, @@ -43,9 +43,9 @@ class Role < ApplicationRecord resource_id = resource&.id unless resource.is_a? Class find_or_create_by!( - name: role_name, + name: role_name, resource_type: resource_type, - resource_id: resource_id, + resource_id: resource_id, ) end diff --git a/config/boot.rb b/config/boot.rb index b9ea538..4be3a6a 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -14,11 +14,11 @@ development_mode = ['', nil, 'development'].include?(env) test_mode = env == 'test' Bootsnap.setup( - cache_dir: cache_dir, - development_mode: development_mode, - load_path_cache: true, + cache_dir: cache_dir, + development_mode: development_mode, + load_path_cache: true, autoload_paths_cache: true, - disable_trace: false, - compile_cache_iseq: test_mode, - compile_cache_yaml: true, + disable_trace: false, + compile_cache_iseq: test_mode, + compile_cache_yaml: true, ) diff --git a/config/environments/production.rb b/config/environments/production.rb index 9074f08..74b6bd1 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -67,9 +67,9 @@ Rails.application.configure do # Use a different cache store in production. cache_conf = Rails.application.settings :cache_store config.cache_store = :redis_cache_store, { - host: cache_conf[:host], - port: cache_conf[:port], - db: cache_conf[:db], + host: cache_conf[:host], + port: cache_conf[:port], + db: cache_conf[:db], password: cache_conf[:password], } diff --git a/config/initializers/action_mailer_smtp_settings.rb b/config/initializers/action_mailer_smtp_settings.rb index 10c2901..8420080 100644 --- a/config/initializers/action_mailer_smtp_settings.rb +++ b/config/initializers/action_mailer_smtp_settings.rb @@ -5,12 +5,12 @@ conf = Rails.application.settings :smtp ActionMailer::Base.smtp_settings = { - address: conf[:address], - port: conf[:port]&.to_i, - domain: conf[:domain], - user_name: conf[:user_name], - password: conf[:password], - authentication: conf[:authentication]&.to_sym, + address: conf[:address], + port: conf[:port]&.to_i, + domain: conf[:domain], + user_name: conf[:user_name], + password: conf[:password], + authentication: conf[:authentication]&.to_sym, enable_starttls_auto: conf[:enable_starttls_auto], - openssl_verify_mode: conf[:openssl_verify_mode], + openssl_verify_mode: conf[:openssl_verify_mode], }.compact.presence diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb index 6ca2c47..25b1375 100644 --- a/config/initializers/sidekiq.rb +++ b/config/initializers/sidekiq.rb @@ -7,18 +7,18 @@ server_conf = Rails.application.settings :sidekiq_server Sidekiq.configure_client do |config| config.redis = { - host: client_conf[:redis_host], - port: client_conf[:redis_port], - db: client_conf[:redis_db], + host: client_conf[:redis_host], + port: client_conf[:redis_port], + db: client_conf[:redis_db], password: client_conf[:redis_password], } end Sidekiq.configure_server do |config| config.redis = { - host: server_conf[:redis_host], - port: server_conf[:redis_port], - db: server_conf[:redis_db], + host: server_conf[:redis_host], + port: server_conf[:redis_port], + db: server_conf[:redis_db], password: server_conf[:redis_password], } end diff --git a/config/initializers/simple_form_bootstrap.rb b/config/initializers/simple_form_bootstrap.rb index e83b290..5697bd7 100644 --- a/config/initializers/simple_form_bootstrap.rb +++ b/config/initializers/simple_form_bootstrap.rb @@ -408,14 +408,14 @@ SimpleForm.setup do |config| # Custom wrappers for input types. This should be a hash containing an input # type as key and the wrapper that will be used for all inputs with specified type. config.wrapper_mappings = { - boolean: :vertical_boolean, - check_boxes: :vertical_collection, - date: :vertical_multi_select, - datetime: :vertical_multi_select, - file: :vertical_file, + boolean: :vertical_boolean, + check_boxes: :vertical_collection, + date: :vertical_multi_select, + datetime: :vertical_multi_select, + file: :vertical_file, radio_buttons: :vertical_collection, - range: :vertical_range, - time: :vertical_multi_select, + range: :vertical_range, + time: :vertical_multi_select, } # enable custom form wrappers diff --git a/config/routes.rb b/config/routes.rb index 72ee9cc..e216759 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -22,11 +22,11 @@ Rails.application.routes.draw do ############### devise_for :users, controllers: { - sessions: 'users/sessions', - registrations: 'users/registrations', - confirmations: 'users/confirmations', - passwords: 'users/passwords', - unlocks: 'users/unlocks', + sessions: 'users/sessions', + registrations: 'users/registrations', + confirmations: 'users/confirmations', + passwords: 'users/passwords', + unlocks: 'users/unlocks', omniauth_callbacks: 'users/omniauth_callbacks', } @@ -56,17 +56,17 @@ Rails.application.routes.draw do resources :people, only: %i[index show] do resources :passports, controller: 'people/passports', - only: :index + only: :index resources :resident_registrations, controller: 'people/resident_registrations', - only: :index + only: :index end resources :passports, only: %i[index show new create] do resources :passport_confirmations, controller: 'passports/passport_confirmations', - only: %i[index create] + only: %i[index create] end resources :membership_apps, only: %i[index show] diff --git a/db/migrate/20181130024918_create_active_storage_tables.active_storage.rb b/db/migrate/20181130024918_create_active_storage_tables.active_storage.rb index 3cdce92..449cdcd 100644 --- a/db/migrate/20181130024918_create_active_storage_tables.active_storage.rb +++ b/db/migrate/20181130024918_create_active_storage_tables.active_storage.rb @@ -22,7 +22,7 @@ class CreateActiveStorageTables < ActiveRecord::Migration[5.2] t.datetime :created_at, null: false t.index %i[record_type record_id name blob_id], - name: 'index_active_storage_attachments_uniqueness', + name: 'index_active_storage_attachments_uniqueness', unique: true end end diff --git a/db/migrate/20181202022901_add_account_to_users.rb b/db/migrate/20181202022901_add_account_to_users.rb index 11c899a..1f72219 100644 --- a/db/migrate/20181202022901_add_account_to_users.rb +++ b/db/migrate/20181202022901_add_account_to_users.rb @@ -4,8 +4,8 @@ class AddAccountToUsers < ActiveRecord::Migration[5.2] def change add_reference :users, :account, - null: false, # rubocop:disable Rails/NotNullColumn - index: { unique: true }, + null: false, # rubocop:disable Rails/NotNullColumn + index: { unique: true }, foreign_key: true end end diff --git a/db/migrate/20181202104848_add_account_to_membership_applications.rb b/db/migrate/20181202104848_add_account_to_membership_applications.rb index b5f0314..e2e29e2 100644 --- a/db/migrate/20181202104848_add_account_to_membership_applications.rb +++ b/db/migrate/20181202104848_add_account_to_membership_applications.rb @@ -3,7 +3,7 @@ class AddAccountToMembershipApplications < ActiveRecord::Migration[5.2] def change add_reference :membership_applications, :account, - null: false, # rubocop:disable Rails/NotNullColumn + null: false, # rubocop:disable Rails/NotNullColumn foreign_key: true end end diff --git a/db/migrate/20181202140310_create_passport_maps.rb b/db/migrate/20181202140310_create_passport_maps.rb index 94fe2a5..0f2cb01 100644 --- a/db/migrate/20181202140310_create_passport_maps.rb +++ b/db/migrate/20181202140310_create_passport_maps.rb @@ -6,7 +6,7 @@ class CreatePassportMaps < ActiveRecord::Migration[5.2] t.timestamps null: false t.references :passport, null: false, - index: { unique: true }, foreign_key: true + index: { unique: true }, foreign_key: true t.string :surname, null: false t.string :given_name, null: false diff --git a/db/migrate/20181202201924_non_unique_passport_for_passport_maps.rb b/db/migrate/20181202201924_non_unique_passport_for_passport_maps.rb index 429c7df..b2dcd44 100644 --- a/db/migrate/20181202201924_non_unique_passport_for_passport_maps.rb +++ b/db/migrate/20181202201924_non_unique_passport_for_passport_maps.rb @@ -3,12 +3,12 @@ class NonUniquePassportForPassportMaps < ActiveRecord::Migration[5.2] def change remove_reference :passport_maps, :passport, - null: false, - index: { unique: true }, + null: false, + index: { unique: true }, foreign_key: true add_reference :passport_maps, :passport, - null: false, # rubocop:disable Rails/NotNullColumn + null: false, # rubocop:disable Rails/NotNullColumn foreign_key: true end end diff --git a/db/migrate/20181206194527_create_membership_pool_apps.rb b/db/migrate/20181206194527_create_membership_pool_apps.rb index 5c6202f..20ff3a3 100644 --- a/db/migrate/20181206194527_create_membership_pool_apps.rb +++ b/db/migrate/20181206194527_create_membership_pool_apps.rb @@ -9,7 +9,7 @@ class CreateMembershipPoolApps < ActiveRecord::Migration[5.2] t.references :membership_app, null: false, foreign_key: true t.index %i[membership_app_id membership_pool_id], - name: 'index_membership_pool_apps_on_app_and_pool', + name: 'index_membership_pool_apps_on_app_and_pool', unique: true end end diff --git a/db/migrate/20181206205529_create_membership_pool_accounts.rb b/db/migrate/20181206205529_create_membership_pool_accounts.rb index b6be12e..9c3f6bb 100644 --- a/db/migrate/20181206205529_create_membership_pool_accounts.rb +++ b/db/migrate/20181206205529_create_membership_pool_accounts.rb @@ -9,7 +9,7 @@ class CreateMembershipPoolAccounts < ActiveRecord::Migration[5.2] t.references :account, null: false, foreign_key: true t.index %i[membership_pool_id account_id], - name: 'index_membership_pool_accounts_on_pool_and_account', + name: 'index_membership_pool_accounts_on_pool_and_account', unique: true end end diff --git a/db/migrate/20181206224446_create_regional_offices.rb b/db/migrate/20181206224446_create_regional_offices.rb index e818876..67cdd9e 100644 --- a/db/migrate/20181206224446_create_regional_offices.rb +++ b/db/migrate/20181206224446_create_regional_offices.rb @@ -6,8 +6,8 @@ class CreateRegionalOffices < ActiveRecord::Migration[5.2] t.timestamps null: false t.references :country_state, - null: false, - index: { unique: true }, + null: false, + index: { unique: true }, foreign_key: true end end diff --git a/db/migrate/20181210024922_add_guest_token_to_accounts.rb b/db/migrate/20181210024922_add_guest_token_to_accounts.rb index a5b19d4..df2e8e9 100644 --- a/db/migrate/20181210024922_add_guest_token_to_accounts.rb +++ b/db/migrate/20181210024922_add_guest_token_to_accounts.rb @@ -3,7 +3,7 @@ class AddGuestTokenToAccounts < ActiveRecord::Migration[5.2] def change add_column :accounts, :guest_token, :string, - null: false, # rubocop:disable Rails/NotNullColumn + null: false, # rubocop:disable Rails/NotNullColumn index: { unique: true } end end diff --git a/db/migrate/20181212000903_create_account_telegram_contacts.rb b/db/migrate/20181212000903_create_account_telegram_contacts.rb index 347ca11..77ac30e 100644 --- a/db/migrate/20181212000903_create_account_telegram_contacts.rb +++ b/db/migrate/20181212000903_create_account_telegram_contacts.rb @@ -6,12 +6,12 @@ class CreateAccountTelegramContacts < ActiveRecord::Migration[5.2] t.timestamps null: false t.references :account, - null: false, + null: false, foreign_key: true t.references :telegram_chat, - null: false, - index: { unique: true }, + null: false, + index: { unique: true }, foreign_key: true end end diff --git a/db/migrate/20190201012021_unique_username_of_accounts.rb b/db/migrate/20190201012021_unique_username_of_accounts.rb index ead7533..0449541 100644 --- a/db/migrate/20190201012021_unique_username_of_accounts.rb +++ b/db/migrate/20190201012021_unique_username_of_accounts.rb @@ -2,7 +2,7 @@ class UniqueUsernameOfAccounts < ActiveRecord::Migration[6.0] def change - change_column :accounts, :username, :string, null: false, + change_column :accounts, :username, :string, null: false, index: { unique: true } end end diff --git a/db/seeds.rb b/db/seeds.rb index 25587fc..78864f3 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -20,9 +20,9 @@ Rails.application.settings(:superuser).tap do |config| new_user.password = config[:password] new_user.confirmed_at = Time.zone.now new_user.account = Account.create!( - nickname: config[:nickname], + nickname: config[:nickname], public_name: config[:public_name], - biography: config[:biography], + biography: config[:biography], ) end.account.add_role :superuser end diff --git a/factories/passports.rb b/factories/passports.rb index a9d1e43..5c8f89a 100644 --- a/factories/passports.rb +++ b/factories/passports.rb @@ -23,7 +23,7 @@ FactoryBot.define do after :build do |passport, evaluator| passport.images.attach( filename: evaluator.image_filename, - io: File.open(evaluator.image_path), + io: File.open(evaluator.image_path), ) end end diff --git a/features/step_definitions/account.rb b/features/step_definitions/account.rb index 6266707..ab6ae37 100644 --- a/features/step_definitions/account.rb +++ b/features/step_definitions/account.rb @@ -4,9 +4,9 @@ When 'there is a usual account with the following data:' do |table| options = table.raw.map { |(k, v)| [k.to_sym, v] }.to_h create :usual_account, - nickname: options[:nickname], + nickname: options[:nickname], public_name: options[:public_name], - biography: options[:biography] + biography: options[:biography] end When 'there is a supporter account with the following data:' do |table| @@ -17,10 +17,10 @@ When 'there is a supporter account with the following data:' do |table| person = create :supporter_person, regional_office: regional_office create :personal_account, - nickname: options[:nickname], + nickname: options[:nickname], public_name: options[:public_name], - biography: options[:biography], - person: person + biography: options[:biography], + person: person end When 'there is a member account with the following data:' do |table| @@ -31,10 +31,10 @@ When 'there is a member account with the following data:' do |table| person = create :member_person, regional_office: regional_office create :personal_account, - nickname: options[:nickname], + nickname: options[:nickname], public_name: options[:public_name], - biography: options[:biography], - person: person + biography: options[:biography], + person: person end When 'there is an excluded member account with the following data:' do |table| @@ -45,8 +45,8 @@ When 'there is an excluded member account with the following data:' do |table| person = create :excluded_person, regional_office: regional_office create :personal_account, - nickname: options[:nickname], + nickname: options[:nickname], public_name: options[:public_name], - biography: options[:biography], - person: person + biography: options[:biography], + person: person end diff --git a/spec/interactors/confirm_passport_spec.rb b/spec/interactors/confirm_passport_spec.rb index ba3396f..324155c 100644 --- a/spec/interactors/confirm_passport_spec.rb +++ b/spec/interactors/confirm_passport_spec.rb @@ -43,8 +43,8 @@ RSpec.describe ConfirmPassport do specify do expect(subject).to have_attributes( - passport: passport, - account: account, + passport: passport, + account: account, passport_confirmation: nil, ) end @@ -59,8 +59,8 @@ RSpec.describe ConfirmPassport do specify do expect(subject).to have_attributes( - passport: passport, - account: account, + passport: passport, + account: account, passport_confirmation: nil, ) end @@ -75,8 +75,8 @@ RSpec.describe ConfirmPassport do specify do expect(subject).to have_attributes( - passport: passport, - account: account, + passport: passport, + account: account, passport_confirmation: nil, ) end diff --git a/spec/requests/membership_apps/create_spec.rb b/spec/requests/membership_apps/create_spec.rb index 7a53e92..142801c 100644 --- a/spec/requests/membership_apps/create_spec.rb +++ b/spec/requests/membership_apps/create_spec.rb @@ -114,8 +114,8 @@ RSpec.describe 'POST /join' do specify do expect(ActionMailer::Base.deliveries.last).to have_attributes( - from: [Rails.application.config.noreply_email_address], - to: [MembershipApp.last.email], + from: [Rails.application.config.noreply_email_address], + to: [MembershipApp.last.email], subject: I18n.t('membership_app_mailer.tracking.subject'), ) end diff --git a/spec/requests/settings/profile/update_spec.rb b/spec/requests/settings/profile/update_spec.rb index 1343ca9..3a086c5 100644 --- a/spec/requests/settings/profile/update_spec.rb +++ b/spec/requests/settings/profile/update_spec.rb @@ -7,9 +7,9 @@ RSpec.describe 'PATCH/PUT /settings/profile' do let :account_attributes do { - nickname: Faker::Internet.username(3..36, %w[_]), + nickname: Faker::Internet.username(3..36, %w[_]), public_name: Faker::Name.name, - biography: Faker::Lorem.paragraph, + biography: Faker::Lorem.paragraph, } end diff --git a/spec/requests/staff/passports/passport_confirmations/create_spec.rb b/spec/requests/staff/passports/passport_confirmations/create_spec.rb index 2891f2b..9800993 100644 --- a/spec/requests/staff/passports/passport_confirmations/create_spec.rb +++ b/spec/requests/staff/passports/passport_confirmations/create_spec.rb @@ -47,7 +47,7 @@ RSpec.describe 'POST /staff/passports/:passport_id/passport_confirmations' do specify do expect(PassportConfirmation.last).to have_attributes( passport: passport, - account: current_account, + account: current_account, ) end end @@ -228,7 +228,7 @@ RSpec.describe 'POST /staff/passports/:passport_id/passport_confirmations' do specify do expect(PassportConfirmation.last).to have_attributes( passport: passport, - account: current_account, + account: current_account, ) end end @@ -264,7 +264,7 @@ RSpec.describe 'POST /staff/passports/:passport_id/passport_confirmations' do specify do expect(PassportConfirmation.last).to have_attributes( passport: passport, - account: current_account, + account: current_account, ) end end diff --git a/spec/requests/users/create_spec.rb b/spec/requests/users/create_spec.rb index f2a0ae7..e4c0c7f 100644 --- a/spec/requests/users/create_spec.rb +++ b/spec/requests/users/create_spec.rb @@ -22,7 +22,7 @@ RSpec.describe 'POST /users' do specify do expect(User.last).to have_attributes user_attributes.merge( - password: nil, + password: nil, password_confirmation: nil, ) end