Skip to content

Commit

Permalink
Merge pull request #59 from SeasonedSoftware/update-rails
Browse files Browse the repository at this point in the history
Update rails
  • Loading branch information
AlanMaik authored May 18, 2021
2 parents 4794f4e + 32cf457 commit 83a9afa
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 46 deletions.
1 change: 1 addition & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ AllCops:
- 'bin/*'
- 'todos/bin/*'
- 'todos/node_modules/**/*'
- 'spec/rails_helper.rb'
Rails:
Enabled: true
Documentation:
Expand Down
90 changes: 45 additions & 45 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,58 +1,58 @@
PATH
remote: .
specs:
croods (0.3.3)
croods (0.3.4)
api-pagination (= 4.8.2)
committee (= 3.3.0)
devise_token_auth (= 1.1.3)
kaminari (= 1.2.1)
pg_search (= 2.3.4)
pundit (= 2.1.0)
rails (= 5.2.5)
rails (= 5.2.6)
schema_associations (= 1.2.7)
schema_auto_foreign_keys (= 0.1.3)
schema_validations (= 2.3.0)

GEM
remote: https://rubygems.org/
specs:
actioncable (5.2.5)
actionpack (= 5.2.5)
actioncable (5.2.6)
actionpack (= 5.2.6)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailer (5.2.5)
actionpack (= 5.2.5)
actionview (= 5.2.5)
activejob (= 5.2.5)
actionmailer (5.2.6)
actionpack (= 5.2.6)
actionview (= 5.2.6)
activejob (= 5.2.6)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (5.2.5)
actionview (= 5.2.5)
activesupport (= 5.2.5)
actionpack (5.2.6)
actionview (= 5.2.6)
activesupport (= 5.2.6)
rack (~> 2.0, >= 2.0.8)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (5.2.5)
activesupport (= 5.2.5)
actionview (5.2.6)
activesupport (= 5.2.6)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
activejob (5.2.5)
activesupport (= 5.2.5)
activejob (5.2.6)
activesupport (= 5.2.6)
globalid (>= 0.3.6)
activemodel (5.2.5)
activesupport (= 5.2.5)
activerecord (5.2.5)
activemodel (= 5.2.5)
activesupport (= 5.2.5)
activemodel (5.2.6)
activesupport (= 5.2.6)
activerecord (5.2.6)
activemodel (= 5.2.6)
activesupport (= 5.2.6)
arel (>= 9.0)
activestorage (5.2.5)
actionpack (= 5.2.5)
activerecord (= 5.2.5)
activestorage (5.2.6)
actionpack (= 5.2.6)
activerecord (= 5.2.6)
marcel (~> 1.0.0)
activesupport (5.2.5)
activesupport (5.2.6)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
Expand All @@ -70,7 +70,7 @@ GEM
rack (>= 1.5)
concurrent-ruby (1.1.8)
crass (1.0.6)
devise (4.7.3)
devise (4.8.0)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 4.1.0)
Expand Down Expand Up @@ -109,23 +109,23 @@ GEM
kaminari-core (= 1.2.1)
kaminari-core (1.2.1)
key_struct (0.4.2)
loofah (2.9.0)
loofah (2.9.1)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.1)
mini_mime (>= 0.1.1)
marcel (1.0.0)
marcel (1.0.1)
method_source (1.0.0)
mini_mime (1.0.3)
mini_portile2 (2.5.0)
mini_mime (1.1.0)
mini_portile2 (2.5.1)
minitest (5.14.4)
modware (0.1.3)
key_struct (~> 0.4)
nio4r (2.5.7)
nokogiri (1.11.2)
nokogiri (1.11.4)
mini_portile2 (~> 2.5.0)
racc (~> 1.4)
openapi_parser (0.12.1)
openapi_parser (0.13.0)
orm_adapter (0.5.0)
parallel (1.19.1)
parser (2.7.1.3)
Expand All @@ -142,27 +142,27 @@ GEM
rack (>= 2.0.0)
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (5.2.5)
actioncable (= 5.2.5)
actionmailer (= 5.2.5)
actionpack (= 5.2.5)
actionview (= 5.2.5)
activejob (= 5.2.5)
activemodel (= 5.2.5)
activerecord (= 5.2.5)
activestorage (= 5.2.5)
activesupport (= 5.2.5)
rails (5.2.6)
actioncable (= 5.2.6)
actionmailer (= 5.2.6)
actionpack (= 5.2.6)
actionview (= 5.2.6)
activejob (= 5.2.6)
activemodel (= 5.2.6)
activerecord (= 5.2.6)
activestorage (= 5.2.6)
activesupport (= 5.2.6)
bundler (>= 1.3.0)
railties (= 5.2.5)
railties (= 5.2.6)
sprockets-rails (>= 2.0.0)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.3.0)
loofah (~> 2.3)
railties (5.2.5)
actionpack (= 5.2.5)
activesupport (= 5.2.5)
railties (5.2.6)
actionpack (= 5.2.6)
activesupport (= 5.2.6)
method_source
rake (>= 0.8.7)
thor (>= 0.19.0, < 2.0)
Expand Down
2 changes: 1 addition & 1 deletion croods.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
spec.add_dependency 'kaminari', '1.2.1'
spec.add_dependency 'pg_search', '2.3.4'
spec.add_dependency 'pundit', '2.1.0'
spec.add_dependency 'rails', '5.2.5'
spec.add_dependency 'rails', '5.2.6'
spec.add_dependency 'schema_associations', '1.2.7'
spec.add_dependency 'schema_auto_foreign_keys', '0.1.3'
spec.add_dependency 'schema_validations', '2.3.0'
Expand Down
11 changes: 11 additions & 0 deletions spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,19 @@
Dir[Rails.root.join('..', 'spec', 'support', '**', '*.rb')]
.sort.each { |f| require f }

# 1. Reduce Devise.stretches
# Explanation: Devise uses bcrypt-ruby by default to encrypt your password. Bcrypt is one of the best choices for such job because, different from other hash libraries like MD5, SHA1, SHA2, it was designed to be slow. So if someone steals your database it will take a long time for them to crack each password in it.
# That said, it is expected that Devise will also be slow during tests as many tests are generating and comparing passwords. For this reason, a very easy way to improve your test suite performance is to reduce the value in Devise.stretches, which represents the cost taken while generating a password with bcrypt. This will make your passwords less secure, but that is ok as long as it applies only to the test environment.
# Latest Devise versions already set stretches to one on test environments in your initializer, but if you have an older application, this will yield a nice improvement!

# 2. Increase your log level
# Explanation: Rails by default logs everything that is happening in your test environment to “log/test.log”. By increasing the logger level, you will be able to reduce the IO during your tests. The only downside of this approach is that, if a test is failing, you won’t have anything logged. In such cases, just comment the configuration option above and run your tests again.
# Checks for pending migrations and applies them before tests are run.
# If you are not using ActiveRecord, you can remove these lines.
Devise.stretches = 1
Rails.logger.level = 4


begin
ActiveRecord::Migration.maintain_test_schema!
rescue ActiveRecord::PendingMigrationError => e
Expand Down

0 comments on commit 83a9afa

Please sign in to comment.