Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
# Omakase Ruby styling for Rails
inherit_gem: { rubocop-rails-omakase: rubocop.yml }

Style/TrailingCommaInArguments:
EnforcedStyleForMultiline: consistent_comma
Style/TrailingCommaInArrayLiteral:
EnforcedStyleForMultiline: consistent_comma
Style/TrailingCommaInHashLiteral:
EnforcedStyleForMultiline: consistent_comma
Style/StringLiterals:
Enabled: true
EnforcedStyle: double_quotes
Include:
- "app/**/*"
- "config/**/*"
- "lib/**/*"
- "spec/**/*"
- "Gemfile"
Bundler/OrderedGems:
Enabled: true

# Overwrite or add rules to create your own house style
#
# # Use `[a, [b, c]]` not `[ a, [ b, c ] ]`
Expand Down
6 changes: 3 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ gem "bcrypt", "~> 3.1.7"
gem "tzinfo-data", platforms: %i[ windows jruby ]

# Use the database-backed adapters for Rails.cache, Active Job, and Action Cable
gem "solid_cable"
gem "solid_cache"
gem "solid_queue"
gem "solid_cable"

# Reduces boot times through caching; required in config/boot.rb
gem "bootsnap", require: false
Expand All @@ -46,17 +46,17 @@ group :development, :test do

# Static analysis for security vulnerabilities [https://brakemanscanner.org/]
gem "brakeman", require: false
gem "factory_bot_rails"

# Omakase Ruby styling [https://github.com/rails/rubocop-rails-omakase/]
gem "rubocop-rails-omakase", require: false

gem "rspec-rails"
gem "factory_bot_rails"
end

group :development do
gem "hotwire-spark"
gem "bullet"
gem "hotwire-spark"
gem "letter_opener"
# Use console on exceptions pages [https://github.com/rails/web-console]
gem "web-console"
Expand Down
2 changes: 1 addition & 1 deletion config/initializers/filter_parameter_logging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
# Use this to limit dissemination of sensitive information.
# See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors.
Rails.application.config.filter_parameters += [
:passw, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn, :cvv, :cvc
:passw, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn, :cvv, :cvc,
]
2 changes: 1 addition & 1 deletion spec/models/region_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'rails_helper'
require "rails_helper"

RSpec.describe Region, type: :model do
it { should validate_presence_of(:name) }
Expand Down
12 changes: 6 additions & 6 deletions spec/rails_helper.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# 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?
# Uncomment the line below in case you have `--require rails_helper` in the `.rspec` file
# that will avoid rails generators crashing because migrations haven't been run yet
# return unless Rails.env.test?
require 'rspec/rails'
require "rspec/rails"
# Add additional requires below this line. Rails is not loaded until this point!

# Requires supporting ruby files with custom matchers and macros, etc, in
Expand All @@ -32,11 +32,11 @@
rescue ActiveRecord::PendingMigrationError => e
abort e.to_s.strip
end
Dir[Rails.root.join('spec', 'support', '**', '*.rb')].each(&method(:require))
Dir[Rails.root.join("spec", "support", "**", "*.rb")].each(&method(:require))
RSpec.configure do |config|
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
config.fixture_paths = [
Rails.root.join('spec/fixtures')
Rails.root.join("spec/fixtures"),
]

# If you're not using ActiveRecord, or you'd prefer not to run each of your
Expand Down
4 changes: 2 additions & 2 deletions spec/views/regions/edit.html.erb_spec.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
require 'rails_helper'
require "rails_helper"

RSpec.describe "regions/edit", type: :view do
let(:region) {
Region.create!(
name: "MyString"
name: "MyString",
)
}

Expand Down
19 changes: 9 additions & 10 deletions spec/views/regions/index.html.erb_spec.rb
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
require 'rails_helper'
require "rails_helper"

RSpec.describe "regions/index", type: :view do
before(:each) do
assign(:regions, [
Region.create!(
name: "Name"
),
Region.create!(
name: "Name"
)
])
assign(
:regions,
[
Region.create!(name: "Name"),
Region.create!(name: "Name"),
],
)
end

it "renders a list of regions" do
render
cell_selector = 'table>tbody>tr'
cell_selector = "table>tbody>tr"
assert_select cell_selector, text: Regexp.new("Name".to_s), count: 2
end
end
6 changes: 2 additions & 4 deletions spec/views/regions/new.html.erb_spec.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
require 'rails_helper'
require "rails_helper"

RSpec.describe "regions/new", type: :view do
before(:each) do
assign(:region, Region.new(
name: "MyString"
))
assign(:region, Region.new(name: "MyString"))
end

it "renders new region form" do
Expand Down
6 changes: 2 additions & 4 deletions spec/views/regions/show.html.erb_spec.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
require 'rails_helper'
require "rails_helper"

RSpec.describe "regions/show", type: :view do
before(:each) do
assign(:region, Region.create!(
name: "Name"
))
assign(:region, Region.create!(name: "Name"))
end

it "renders attributes in <p>" do
Expand Down