Skip to content

Commit

Permalink
Merge branch 'lb/hacktoberfest' of github.com:leonardobrito/rails_boi…
Browse files Browse the repository at this point in the history
…lerplate into lb/hacktoberfest
  • Loading branch information
Leonardo Brito committed Oct 2, 2023
2 parents 9a42f90 + 7acab7a commit a635df6
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,4 @@ jobs:
run: RAILS_ENV=test bundle exec rails db:create db:schema:load

- name: Run tests
run: bundle exec rspec spec --format progress
run: bundle exec bin/rspec spec --format progress
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ group :development do
# gem "rack-mini-profiler"

# Speed up commands on slow machines / big apps [https://github.com/rails/spring]
# gem "spring"
gem "spring"
gem "pry", "~> 0.14.2"
gem "reek"
end
Expand All @@ -97,4 +97,5 @@ group :test do
gem "selenium-webdriver"
gem "shoulda-matchers", "~> 5.0"
gem "simplecov", require: false
gem "spring-commands-rspec"
end
5 changes: 5 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,9 @@ GEM
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.4)
spring (4.1.1)
spring-commands-rspec (1.0.4)
spring (>= 0.9.1)
sprockets (4.2.1)
concurrent-ruby (~> 1.0)
rack (>= 2.2.4, < 4)
Expand Down Expand Up @@ -413,6 +416,8 @@ DEPENDENCIES
shoulda-matchers (~> 5.0)
sidekiq
simplecov
spring
spring-commands-rspec
sprockets-rails
stimulus-rails
turbo-rails
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
- visit http://localhost:3000/

## Run tests
- docker compose exec web bundle exec rspec
- docker compose exec web bundle exec bin/rspec
- open coverage/index.html (Check coverage report)

## Check lint
Expand Down
1 change: 1 addition & 0 deletions bin/rails
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
load File.expand_path("spring", __dir__)
APP_PATH = File.expand_path("../config/application", __dir__)
require_relative "../config/boot"
require "rails/commands"
1 change: 1 addition & 0 deletions bin/rake
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
load File.expand_path("spring", __dir__)
require_relative "../config/boot"
require "rake"
Rake.application.run
4 changes: 4 additions & 0 deletions bin/rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env ruby
load File.expand_path("spring", __dir__)
require 'bundler/setup'
load Gem.bin_path('rspec-core', 'rspec')
14 changes: 14 additions & 0 deletions bin/spring
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env ruby

# This file loads Spring without using loading other gems in the Gemfile, in order to be fast.
# It gets overwritten when you run the `spring binstub` command.

if !defined?(Spring) && [nil, "development", "test"].include?(ENV["RAILS_ENV"])
require "bundler"

Bundler.locked_gems.specs.find { |spec| spec.name == "spring" }&.tap do |spring|
Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path
gem "spring", spring.version
require "spring/binstub"
end
end
3 changes: 2 additions & 1 deletion config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
# Settings specified here will take precedence over those in config/application.rb.

# Turn false under Spring and add config.action_view.cache_template_loading = true.
config.cache_classes = true
config.cache_classes = false
config.action_view.cache_template_loading = true

# Eager loading loads your whole application. When running a single test locally,
# this probably isn't necessary. It's a good idea to do in a continuous integration
Expand Down

0 comments on commit a635df6

Please sign in to comment.