Skip to content

Commit

Permalink
Fix files according to standardrb
Browse files Browse the repository at this point in the history
  • Loading branch information
phylor committed Sep 30, 2022
1 parent 7db0b5c commit 1c455a0
Show file tree
Hide file tree
Showing 10 changed files with 67 additions and 81 deletions.
2 changes: 1 addition & 1 deletion app/helpers/heroicon_helper.rb
Expand Up @@ -2,4 +2,4 @@

module HeroiconHelper
include Heroicon::Engine.helpers
end
end
3 changes: 1 addition & 2 deletions config/environments/development.rb
@@ -1,7 +1,7 @@
require "active_support/core_ext/integer/time"

Rails.application.configure do
config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
config.action_mailer.default_url_options = {host: "localhost", port: 3000}
# Settings specified here will take precedence over those in config/application.rb.

# In the development environment your application's code is reloaded any time
Expand Down Expand Up @@ -57,7 +57,6 @@
# Highlight code that triggered database queries in logs.
config.active_record.verbose_query_logs = true


# Raises error for missing translations.
# config.i18n.raise_on_missing_translations = true

Expand Down
2 changes: 1 addition & 1 deletion config/environments/test.rb
Expand Up @@ -23,7 +23,7 @@
}

# Show full error reports and disable caching.
config.consider_all_requests_local = true
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
config.cache_store = :null_store

Expand Down
11 changes: 6 additions & 5 deletions config/initializers/simple_form.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true

#
# Uncomment this and change the path if necessary to include your own
# components.
Expand Down Expand Up @@ -54,8 +55,8 @@
## Inputs
# b.use :input, class: 'input', error_class: 'is-invalid', valid_class: 'is-valid'
b.use :label_input
b.use :hint, wrap_with: { tag: :span, class: :hint }
b.use :error, wrap_with: { tag: :span, class: :error }
b.use :hint, wrap_with: {tag: :span, class: :hint}
b.use :error, wrap_with: {tag: :span, class: :error}

## full_messages_for
# If you want to display the full error message for the attribute, you can
Expand All @@ -74,7 +75,7 @@
config.boolean_style = :nested

# Default class for buttons
config.button_class = 'btn'
config.button_class = "btn"

# Method used to tidy up errors. Specify any Rails Array method.
# :first lists the first message for each field.
Expand All @@ -85,7 +86,7 @@
config.error_notification_tag = :div

# CSS class to add for error notification helper.
config.error_notification_class = 'error_notification'
config.error_notification_class = "error_notification"

# Series of attempts to detect a default label method for collection.
# config.collection_label_methods = [ :to_label, :name, :title, :to_s ]
Expand Down Expand Up @@ -161,7 +162,7 @@
# config.input_class = nil

# Define the default class of the input wrapper of the boolean input.
config.boolean_label_class = 'checkbox'
config.boolean_label_class = "checkbox"

# Defines if the default input wrapper class should be included in radio
# collection wrappers.
Expand Down
4 changes: 2 additions & 2 deletions config/puma.rb
Expand Up @@ -4,7 +4,7 @@
# the maximum value specified for Puma. Default is set to 5 threads for minimum
# and maximum; this matches the default thread size of Active Record.
#
max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
max_threads_count = ENV.fetch("RAILS_MAX_THREADS", 5)
min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count }
threads min_threads_count, max_threads_count

Expand All @@ -15,7 +15,7 @@

# Specifies the `port` that Puma will listen on to receive requests; default is 3000.
#
port ENV.fetch("PORT") { 3000 }
port ENV.fetch("PORT", 3000)

# Specifies the `environment` that Puma will run in.
#
Expand Down
7 changes: 3 additions & 4 deletions db/migrate/20220808151443_devise_create_users.rb
Expand Up @@ -4,11 +4,11 @@ class DeviseCreateUsers < ActiveRecord::Migration[7.0]
def change
create_table :users do |t|
## Database authenticatable
t.string :email, null: false, default: ""
t.string :email, null: false, default: ""
t.string :encrypted_password, null: false, default: ""

## Recoverable
t.string :reset_password_token
t.string :reset_password_token
t.datetime :reset_password_sent_at

## Rememberable
Expand All @@ -32,11 +32,10 @@ def change
# t.string :unlock_token # Only if unlock strategy is :email or :both
# t.datetime :locked_at


t.timestamps null: false
end

add_index :users, :email, unique: true
add_index :users, :email, unique: true
add_index :users, :reset_password_token, unique: true
# add_index :users, :confirmation_token, unique: true
# add_index :users, :unlock_token, unique: true
Expand Down
5 changes: 0 additions & 5 deletions spec/factories/users.rb

This file was deleted.

5 changes: 0 additions & 5 deletions spec/models/user_spec.rb

This file was deleted.

17 changes: 8 additions & 9 deletions spec/rails_helper.rb
@@ -1,17 +1,16 @@
# This file is copied to spec/ when you run 'rails generate rspec:install'
require 'spec_helper'
ENV['RAILS_ENV'] ||= 'test'
require_relative '../config/environment'
require "spec_helper"
ENV["RAILS_ENV"] ||= "test"
require_relative "../config/environment"
# Prevent database truncation if the environment is production
abort("The Rails environment is running in production mode!") if Rails.env.production?
require 'rspec/rails'
require "rspec/rails"
# Add additional requires below this line. Rails is not loaded until this point!
require 'capybara/rspec'
require 'capybara/rails'
require 'capybara-screenshot/rspec'

Capybara.asset_host = 'http://localhost:3000'
require "capybara/rspec"
require "capybara/rails"
require "capybara-screenshot/rspec"

Capybara.asset_host = "http://localhost:3000"

# Requires supporting ruby files with custom matchers and macros, etc, in
# spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
Expand Down
92 changes: 45 additions & 47 deletions spec/spec_helper.rb
Expand Up @@ -44,51 +44,49 @@
# triggering implicit auto-inclusion in groups with matching metadata.
config.shared_context_metadata_behavior = :apply_to_host_groups

# The settings below are suggested to provide a good initial experience
# with RSpec, but feel free to customize to your heart's content.
=begin
# This allows you to limit a spec run to individual examples or groups
# you care about by tagging them with `:focus` metadata. When nothing
# is tagged with `:focus`, all examples get run. RSpec also provides
# aliases for `it`, `describe`, and `context` that include `:focus`
# metadata: `fit`, `fdescribe` and `fcontext`, respectively.
config.filter_run_when_matching :focus
# Allows RSpec to persist some state between runs in order to support
# the `--only-failures` and `--next-failure` CLI options. We recommend
# you configure your source control system to ignore this file.
config.example_status_persistence_file_path = "spec/examples.txt"
# Limits the available syntax to the non-monkey patched syntax that is
# recommended. For more details, see:
# https://relishapp.com/rspec/rspec-core/docs/configuration/zero-monkey-patching-mode
config.disable_monkey_patching!
# Many RSpec users commonly either run the entire suite or an individual
# file, and it's useful to allow more verbose output when running an
# individual spec file.
if config.files_to_run.one?
# Use the documentation formatter for detailed output,
# unless a formatter has already been configured
# (e.g. via a command-line flag).
config.default_formatter = "doc"
end
# Print the 10 slowest examples and example groups at the
# end of the spec run, to help surface which specs are running
# particularly slow.
config.profile_examples = 10
# Run specs in random order to surface order dependencies. If you find an
# order dependency and want to debug it, you can fix the order by providing
# the seed, which is printed after each run.
# --seed 1234
config.order = :random
# Seed global randomization in this process using the `--seed` CLI option.
# Setting this allows you to use `--seed` to deterministically reproduce
# test failures related to randomization by passing the same `--seed` value
# as the one that triggered the failure.
Kernel.srand config.seed
=end
# The settings below are suggested to provide a good initial experience
# with RSpec, but feel free to customize to your heart's content.
# # This allows you to limit a spec run to individual examples or groups
# # you care about by tagging them with `:focus` metadata. When nothing
# # is tagged with `:focus`, all examples get run. RSpec also provides
# # aliases for `it`, `describe`, and `context` that include `:focus`
# # metadata: `fit`, `fdescribe` and `fcontext`, respectively.
# config.filter_run_when_matching :focus
#
# # Allows RSpec to persist some state between runs in order to support
# # the `--only-failures` and `--next-failure` CLI options. We recommend
# # you configure your source control system to ignore this file.
# config.example_status_persistence_file_path = "spec/examples.txt"
#
# # Limits the available syntax to the non-monkey patched syntax that is
# # recommended. For more details, see:
# # https://relishapp.com/rspec/rspec-core/docs/configuration/zero-monkey-patching-mode
# config.disable_monkey_patching!
#
# # Many RSpec users commonly either run the entire suite or an individual
# # file, and it's useful to allow more verbose output when running an
# # individual spec file.
# if config.files_to_run.one?
# # Use the documentation formatter for detailed output,
# # unless a formatter has already been configured
# # (e.g. via a command-line flag).
# config.default_formatter = "doc"
# end
#
# # Print the 10 slowest examples and example groups at the
# # end of the spec run, to help surface which specs are running
# # particularly slow.
# config.profile_examples = 10
#
# # Run specs in random order to surface order dependencies. If you find an
# # order dependency and want to debug it, you can fix the order by providing
# # the seed, which is printed after each run.
# # --seed 1234
# config.order = :random
#
# # Seed global randomization in this process using the `--seed` CLI option.
# # Setting this allows you to use `--seed` to deterministically reproduce
# # test failures related to randomization by passing the same `--seed` value
# # as the one that triggered the failure.
# Kernel.srand config.seed
end

0 comments on commit 1c455a0

Please sign in to comment.