diff --git a/.rspec b/.rspec new file mode 100644 index 0000000..c99d2e7 --- /dev/null +++ b/.rspec @@ -0,0 +1 @@ +--require spec_helper diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000..a7e0e30 --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,34 @@ +AllCops: + Exclude: + - "bin/*" + - "db/**/*" + - "config/**/*" + - "Guardfile" + - "Rakefile" + DisplayCopNames: true + +Metrics/LineLength: + Max: 120 +Metrics/MethodLength: + Include: ["app/controllers/*"] + Max: 20 +Metrics/AbcSize: + Include: ["app/controllers/*"] + Max: 30 +Metrics/ClassLength: + Max: 150 +Metrics/BlockLength: + ExcludedMethods: ['describe'] + +Style/Documentation: + Enabled: false +Style/ClassAndModuleChildren: + Enabled: false + +Layout/AlignHash: + EnforcedColonStyle: key +Layout/ExtraSpacing: + AllowForAlignment: false +Layout/MultilineMethodCallIndentation: + Enabled: true + EnforcedStyle: indented diff --git a/.stickler.yml b/.stickler.yml new file mode 100644 index 0000000..ed47a0c --- /dev/null +++ b/.stickler.yml @@ -0,0 +1,10 @@ +linters: + rubocop: + display_cop_names: true +files: + ignore: + - "bin/*" + - "db/*" + - "config/*" + - "Guardfile" + - "Rakefile" \ No newline at end of file diff --git a/Gemfile b/Gemfile index 6bd38bb..a863c09 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" } @@ -5,8 +7,8 @@ ruby '2.6.1' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 5.2.3' -# Use sqlite3 as the database for Active Record -gem 'sqlite3' +# Use postgresql as the database for Active Record +gem 'pg', '>= 0.18', '< 2.0' # Use Puma as the app server gem 'puma', '~> 3.11' # Use SCSS for stylesheets @@ -16,6 +18,13 @@ gem 'uglifier', '>= 1.3.0' # See https://github.com/rails/execjs#readme for more supported runtimes # gem 'mini_racer', platforms: :ruby +group :development, :test do + gem 'byebug', platform: :mri + gem 'database_cleaner' + gem 'factory_bot_rails' + gem 'rspec-rails', '~> 3.5' +end + # Use CoffeeScript for .coffee assets and views gem 'coffee-rails', '~> 4.2' # Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks @@ -36,15 +45,19 @@ gem 'jbuilder', '~> 2.5' # Reduces boot times through caching; required in config/boot.rb gem 'bootsnap', '>= 1.1.0', require: false -group :development, :test do - # Call 'byebug' anywhere in the code to stop execution and get a debugger console - gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] -end +# omniauth +gem 'omniauth' +gem 'omniauth-facebook' +gem 'omniauth-github' +gem 'therubyracer' + +# devise +gem 'devise' group :development do # Access an interactive console on exception pages or by calling 'console' anywhere in the code. - gem 'web-console', '>= 3.3.0' gem 'listen', '>= 3.0.5', '< 3.2' + gem 'web-console', '>= 3.3.0' # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring gem 'spring' gem 'spring-watcher-listen', '~> 2.0.0' @@ -59,4 +72,4 @@ group :test do end # Windows does not include zoneinfo files, so bundle the tzinfo-data gem -gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] +gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby] diff --git a/Gemfile.lock b/Gemfile.lock index 88b949a..243f31a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -47,12 +47,13 @@ GEM archive-zip (0.12.0) io-like (~> 0.3.0) arel (9.0.0) + bcrypt (3.1.13) bindex (0.8.1) bootsnap (1.4.5) msgpack (~> 1.0) builder (3.2.3) byebug (11.0.1) - capybara (3.28.0) + capybara (3.29.0) addressable mini_mime (>= 0.1.3) nokogiri (~> 1.8) @@ -74,16 +75,34 @@ GEM coffee-script-source (1.12.2) concurrent-ruby (1.1.5) crass (1.0.4) + database_cleaner (1.7.0) + devise (4.7.1) + bcrypt (~> 3.0) + orm_adapter (~> 0.1) + railties (>= 4.1.0) + responders + warden (~> 1.2.3) + diff-lcs (1.3) erubi (1.8.0) execjs (2.7.0) + factory_bot (5.0.2) + activesupport (>= 4.2.0) + factory_bot_rails (5.0.2) + factory_bot (~> 5.0.2) + railties (>= 4.2.0) + faraday (0.15.4) + multipart-post (>= 1.2, < 3) ffi (1.11.1) globalid (0.4.2) activesupport (>= 4.2.0) + hashie (3.6.0) i18n (1.6.0) concurrent-ruby (~> 1.0) io-like (0.3.0) jbuilder (2.9.1) activesupport (>= 4.2.0) + jwt (2.2.1) + libv8 (3.16.14.19) listen (3.1.5) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) @@ -101,9 +120,31 @@ GEM mini_portile2 (2.4.0) minitest (5.11.3) msgpack (1.3.1) + multi_json (1.13.1) + multi_xml (0.6.0) + multipart-post (2.1.1) nio4r (2.5.1) nokogiri (1.10.4) mini_portile2 (~> 2.4.0) + oauth2 (1.4.1) + faraday (>= 0.8, < 0.16.0) + jwt (>= 1.0, < 3.0) + multi_json (~> 1.3) + multi_xml (~> 0.5) + rack (>= 1.2, < 3) + omniauth (1.9.0) + hashie (>= 3.4.6, < 3.7.0) + rack (>= 1.6.2, < 3) + omniauth-facebook (5.0.0) + omniauth-oauth2 (~> 1.2) + omniauth-github (1.3.0) + omniauth (~> 1.5) + omniauth-oauth2 (>= 1.4.0, < 2.0) + omniauth-oauth2 (1.6.0) + oauth2 (~> 1.1) + omniauth (~> 1.9) + orm_adapter (0.5.0) + pg (1.1.4) public_suffix (4.0.1) puma (3.12.1) rack (2.0.7) @@ -137,9 +178,30 @@ GEM rb-fsevent (0.10.3) rb-inotify (0.10.0) ffi (~> 1.0) + ref (2.0.0) regexp_parser (1.6.0) + responders (3.0.0) + actionpack (>= 5.0) + railties (>= 5.0) + rspec-core (3.8.2) + rspec-support (~> 3.8.0) + rspec-expectations (3.8.4) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.8.0) + rspec-mocks (3.8.1) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.8.0) + rspec-rails (3.8.2) + actionpack (>= 3.0) + activesupport (>= 3.0) + railties (>= 3.0) + rspec-core (~> 3.8.0) + rspec-expectations (~> 3.8.0) + rspec-mocks (~> 3.8.0) + rspec-support (~> 3.8.0) + rspec-support (3.8.2) ruby_dep (1.5.0) - rubyzip (1.2.3) + rubyzip (1.2.4) sass (3.7.4) sass-listen (~> 4.0.0) sass-listen (4.0.0) @@ -165,7 +227,9 @@ GEM actionpack (>= 4.0) activesupport (>= 4.0) sprockets (>= 3.0.0) - sqlite3 (1.4.1) + therubyracer (0.12.3) + libv8 (~> 3.16.14.15) + ref thor (0.20.3) thread_safe (0.3.6) tilt (2.0.9) @@ -176,6 +240,8 @@ GEM thread_safe (~> 0.1) uglifier (4.1.20) execjs (>= 0.3.0, < 3) + warden (1.2.8) + rack (>= 2.0.6) web-console (3.7.0) actionview (>= 5.0) activemodel (>= 5.0) @@ -196,15 +262,23 @@ DEPENDENCIES capybara (>= 2.15) chromedriver-helper coffee-rails (~> 4.2) + database_cleaner + devise + factory_bot_rails jbuilder (~> 2.5) listen (>= 3.0.5, < 3.2) + omniauth + omniauth-facebook + omniauth-github + pg (>= 0.18, < 2.0) puma (~> 3.11) rails (~> 5.2.3) + rspec-rails (~> 3.5) sass-rails (~> 5.0) selenium-webdriver spring spring-watcher-listen (~> 2.0.0) - sqlite3 + therubyracer turbolinks (~> 5) tzinfo-data uglifier (>= 1.3.0) diff --git a/app/channels/application_cable/channel.rb b/app/channels/application_cable/channel.rb index d672697..9aec230 100644 --- a/app/channels/application_cable/channel.rb +++ b/app/channels/application_cable/channel.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ApplicationCable class Channel < ActionCable::Channel::Base end diff --git a/app/channels/application_cable/connection.rb b/app/channels/application_cable/connection.rb index 0ff5442..8d6c2a1 100644 --- a/app/channels/application_cable/connection.rb +++ b/app/channels/application_cable/connection.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ApplicationCable class Connection < ActionCable::Connection::Base end diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 09705d1..7944f9f 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,2 +1,4 @@ +# frozen_string_literal: true + class ApplicationController < ActionController::Base end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index de6be79..15b06f0 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,2 +1,4 @@ +# frozen_string_literal: true + module ApplicationHelper end diff --git a/app/jobs/application_job.rb b/app/jobs/application_job.rb index a009ace..d92ffdd 100644 --- a/app/jobs/application_job.rb +++ b/app/jobs/application_job.rb @@ -1,2 +1,4 @@ +# frozen_string_literal: true + class ApplicationJob < ActiveJob::Base end diff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rb index 286b223..d84cb6e 100644 --- a/app/mailers/application_mailer.rb +++ b/app/mailers/application_mailer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ApplicationMailer < ActionMailer::Base default from: 'from@example.com' layout 'mailer' diff --git a/app/models/application_record.rb b/app/models/application_record.rb index 10a4cba..71fbba5 100644 --- a/app/models/application_record.rb +++ b/app/models/application_record.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ApplicationRecord < ActiveRecord::Base self.abstract_class = true end diff --git a/config.ru b/config.ru index f7ba0b5..842bccc 100644 --- a/config.ru +++ b/config.ru @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This file is used by Rack-based servers to start the application. require_relative 'config/environment' diff --git a/config/credentials.yml.enc b/config/credentials.yml.enc index e140de2..9d45331 100644 --- a/config/credentials.yml.enc +++ b/config/credentials.yml.enc @@ -1 +1 @@ -a2rGL0CxSumQsbz6t0o/0Z44kniZq6/jK9qffLQ/xQEByO2BUv5dqb/nf9ljnTeCyOfM64ADFb8OjinQpLGzDDXTIr5mFg+bhJrpomZcJEyUyONvSOtq1JnkWrEvNFMjwGOGcH1IAAitCVupBhnvBOpPehxxeD9lhtOMH/xWQmompltLTWL512Fc1szMEQ8spMHZ8Lw4cV4qcd7xLdVCpiuo+yhXqKR9Y+5xvr/oP+cPNs5lla2SSBvDyZ9Q1W8pSxWM7nTc9zJaA1SlZpj30vhKgeAr5MFfXm25Kj7WJ2kAa6Rjx8Rx5yjgK7bSmbaJbv4H932Z8FwUuVtXE9R6aJDqP8XV6H7Rr8xbkZST0NRDxvMV87HLvkDt1E4DbOb3/NDdeRNGtcLKsgLbfidsxhfuxjULFlVQwCFO--OjRK5YNpxy1ihLfb--z07CLCqgNEZhGMujmH0Cxw== \ No newline at end of file +fo4gHtVg/iAuDW6HLWEY9vSfIsulAuTV1dxliVJqEWS/FhB62WJ7ejTCjYqQzq9oAMTf6v2gULo5tSO96jq+oo/eqgUTLQOHSOjhIrl/hRK7cxh/0+Zd9I4q7O3y6jDiNac5rWBAUmfCZvpCTycfKu31VdIsnAji8CQ59DPFBGyCEQy73JjeHYPkZiDuPB//FzVof5Gd8v8m2oZSd6lrm/NL1ND041e21AgDv7FehOmPGKkxsAANGJRTvnGAH4k0E1c/TxDOfGlBPyA5Ci28FkfkRwuSRHt5zhuiz6/jZ3Cso0VQb8bfIsT+90lMoWFv7x3/gSMjjOp9YiiLAVRotIy+XyBzh7kYxlv2bWDReHSPTOgSOpY9z7XGG7rYxVUEvNXhNl4zG8vKBmC3enDLd1NB9uQyV0Zn98FU--tFYGnFF4TRH6dGHW--mMVvcVMNI4FZFy0q7I0J1A== \ No newline at end of file diff --git a/config/database.yml b/config/database.yml index 0d02f24..82829c4 100644 --- a/config/database.yml +++ b/config/database.yml @@ -1,25 +1,109 @@ -# SQLite version 3.x -# gem install sqlite3 +# PostgreSQL. Versions 9.1 and up are supported. # -# Ensure the SQLite 3 gem is defined in your Gemfile -# gem 'sqlite3' +# Install the pg driver: +# gem install pg +# On OS X with Homebrew: +# gem install pg -- --with-pg-config=/usr/local/bin/pg_config +# On OS X with MacPorts: +# gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config +# On Windows: +# gem install pg +# Choose the win32 build. +# Install PostgreSQL and put its /bin directory on your path. # +# Configure Using Gemfile +# gem 'pg' +# + +# default: &default +# adapter: postgresql +# pool: 5 +# host: localhost + +# development: +# <<: *default +# database: postgres +# username: social +# password: 123456 + + default: &default - adapter: sqlite3 - pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> - timeout: 5000 + adapter: postgresql + # For details on connection pooling, see Rails configuration guide + # http://guides.rubyonrails.org/configuring.html#database-pooling + pool: 5 + host: localhost development: <<: *default - database: db/development.sqlite3 + database: postgres + username: social + password: 123456 + #host: localhost + pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> + + + + # The specified database role being used to connect to postgres. + # To create additional roles in postgres see `$ createuser --help`. + # When left blank, postgres will use the default role. This is + # the same name as the operating system user that initialized the database. + + # The password associated with the postgres role (username). + + # Connect on a TCP socket. Omitted by default since the client uses a + # domain socket that doesn't need configuration. Windows does not have + # domain sockets, so uncomment these lines. + #host: localhost + + # The TCP port the server listens on. Defaults to 5432. + # If your server runs on a different port number, change accordingly. + # port: 5432 + + # Schema search path. The server defaults to $user,public + #schema_search_path: myapp,sharedapp,public + + # Minimum log levels, in increasing order: + # debug5, debug4, debug3, debug2, debug1, + # log, notice, warning, error, fatal, and panic + # Defaults to warning. + #min_messages: notice # Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". # Do not set this db to the same as development or production. test: <<: *default - database: db/test.sqlite3 + database: socialn_test + username: social + password: 123456 + host: localhost + pool: 5 + + + +# As with config/secrets.yml, you never want to store sensitive information, +# like your database password, in your source code. If your source code is +# ever seen by anyone, they now have access to your database. +# +# Instead, provide the password as a unix environment variable when you boot +# the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database +# for a full rundown on how to provide these environment variables in a +# production deployment. +# +# On Heroku and other platform providers, you may have a full connection URL +# available as an environment variable. For example: +# +# DATABASE_URL="postgres://myuser:mypass@localhost/somedatabase" +# +# You can use this database configuration with: +# +# production: +# url: <%= ENV['DATABASE_URL'] %> +# production: <<: *default - database: db/production.sqlite3 + database: socialn_prod + username: social + password: 123456 diff --git a/config/routes.rb b/config/routes.rb index 787824f..40c0b56 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,3 +1,4 @@ Rails.application.routes.draw do # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html + end diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb new file mode 100644 index 0000000..54ac598 --- /dev/null +++ b/spec/rails_helper.rb @@ -0,0 +1,82 @@ +# frozen_string_literal: true + +# This file is copied to spec/ when you run 'rails generate rspec:install' +require 'spec_helper' +require 'capybara/rspec' + +ENV['RAILS_ENV'] ||= 'test' +require File.expand_path('../config/environment', __dir__) +# Prevent database truncation if the environment is production +abort('The Rails environment is running in production mode!') if Rails.env.production? +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 +# spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are +# run as spec files by default. This means that files in spec/support that end +# in _spec.rb will both be required and run as specs, causing the specs to be +# run twice. It is recommended that you do not name files matching this glob to +# end with _spec.rb. You can configure this pattern with the --pattern +# option on the command line or in ~/.rspec, .rspec or `.rspec-local`. +# +# The following line is provided for convenience purposes. It has the downside +# of increasing the boot-up time by auto-requiring all files in the support +# directory. Alternatively, in the individual `*_spec.rb` files, manually +# require only the support files necessary. +# +# Dir[Rails.root.join('spec', 'support', '**', '*.rb')].each { |f| require f } + +# Checks for pending migrations and applies them before tests are run. +# If you are not using ActiveRecord, you can remove these lines. +begin + ActiveRecord::Migration.maintain_test_schema! +rescue ActiveRecord::PendingMigrationError => e + puts e.to_s.strip + exit 1 +end +RSpec.configure do |config| + # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures + config.include FactoryBot::Syntax::Methods + config.include Devise::Test::ControllerHelpers, type: :controller + config.use_transactional_fixtures = false + config.before(:suite) do + DatabaseCleaner.clean_with(:truncation) + end + config.before(:each) do + DatabaseCleaner.strategy = :transaction + DatabaseCleaner.start + end + config.before(:each, js: true) do + DatabaseCleaner.strategy = :truncation + end + config.after(:each) do + DatabaseCleaner.clean + end + config.before(:all) do + DatabaseCleaner.start + end + config.after(:all) do + DatabaseCleaner.clean + end + # If you're not using ActiveRecord, or you'd prefer not to run each of your + # examples within a transaction, remove the following line or assign false + # instead of true. + # RSpec Rails can automatically mix in different behaviours to your tests + # based on their file location, for example enabling you to call `get` and + # `post` in specs under `spec/controllers`. + # + # You can disable this behaviour by removing the line below, and instead + # explicitly tag your specs with their type, e.g.: + # + # RSpec.describe UsersController, :type => :controller do + # # ... + # end + # + # The different available types are documented in the features, such as in + # https://relishapp.com/rspec/rspec-rails/docs + config.infer_spec_type_from_file_location! + # Filter lines from Rails gems in backtraces. + config.filter_rails_from_backtrace! + # arbitrary gems may also be filtered via: + # config.filter_gems_from_backtrace("gem name") +end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb new file mode 100644 index 0000000..01f7c97 --- /dev/null +++ b/spec/spec_helper.rb @@ -0,0 +1,96 @@ +# frozen_string_literal: true + +# This file was generated by the `rails generate rspec:install` command. Conventionally, all +# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. +# The generated `.rspec` file contains `--require spec_helper` which will cause +# this file to always be loaded, without a need to explicitly require it in any +# files. +# +# Given that it is always loaded, you are encouraged to keep this file as +# light-weight as possible. Requiring heavyweight dependencies from this file +# will add to the boot time of your test suite on EVERY test run, even for an +# individual file that may not need all of that loaded. Instead, consider making +# a separate helper file that requires the additional dependencies and performs +# the additional setup, and require it from the spec files that actually need +# it. +# +# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration +RSpec.configure do |config| + # rspec-expectations config goes here. You can use an alternate + # assertion/expectation library such as wrong or the stdlib/minitest + # assertions if you prefer. + config.expect_with :rspec do |expectations| + # This option will default to `true` in RSpec 4. It makes the `description` + # and `failure_message` of custom matchers include text for helper methods + # defined using `chain`, e.g.: + # be_bigger_than(2).and_smaller_than(4).description + # # => "be bigger than 2 and smaller than 4" + # ...rather than: + # # => "be bigger than 2" + expectations.include_chain_clauses_in_custom_matcher_descriptions = true + end + + # rspec-mocks config goes here. You can use an alternate test double + # library (such as bogus or mocha) by changing the `mock_with` option here. + config.mock_with :rspec do |mocks| + # Prevents you from mocking or stubbing a method that does not exist on + # a real object. This is generally recommended, and will default to + # `true` in RSpec 4. + mocks.verify_partial_doubles = true + end + + # This option will default to `:apply_to_host_groups` in RSpec 4 (and will + # have no way to turn it off -- the option exists only for backwards + # compatibility in RSpec 3). It causes shared context metadata to be + # inherited by the metadata hash of host groups and examples, rather than + # 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. + # # 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: + # # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/ + # # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/ + # # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#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 diff --git a/test/application_system_test_case.rb b/test/application_system_test_case.rb index d19212a..652febb 100644 --- a/test/application_system_test_case.rb +++ b/test/application_system_test_case.rb @@ -1,4 +1,6 @@ -require "test_helper" +# frozen_string_literal: true + +require 'test_helper' class ApplicationSystemTestCase < ActionDispatch::SystemTestCase driven_by :selenium, using: :chrome, screen_size: [1400, 1400] diff --git a/test/test_helper.rb b/test/test_helper.rb index 3ab84e3..2ee518e 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + ENV['RAILS_ENV'] ||= 'test' require_relative '../config/environment' require 'rails/test_help'