Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[D-299] Add test for Rails 7.1 and 7.2 #38

Merged
merged 6 commits into from
Sep 5, 2024
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
12 changes: 12 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,19 @@ jobs:
- ruby: 3.0.0
directory: 'spec/rails-7.0'
- ruby: 3.1.1
directory: 'spec/rails-6.1'
- ruby: 3.1.1
directory: 'spec/rails-7.0'
- ruby: 3.1.1
directory: 'spec/rails-7.1'
- ruby: 3.1.1
directory: 'spec/rails-7.2'
- ruby: 3.3.3
directory: 'spec/rails-7.0'
- ruby: 3.3.3
directory: 'spec/rails-7.1'
- ruby: 3.3.3
directory: 'spec/rails-7.2'
steps:
- uses: actions/checkout@v2
- name: Install ruby
Expand Down
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,20 @@ Rails.application.config.content_security_policy do |policy|

### Rails compatibility

The gem is tested to work with Rails 3.2+ and Ruby 2.5.8+.
The gem is tested against

| Versions | Ruby 2.5.8 | Ruby 2.6.6 | Ruby 2.7.2 | Ruby 3.0.0 | Ruby 3.1.1 | Ruby 3.3.3 |
|-----------|:------------------:|:------------------:|:------------------:|:------------------:|:------------------:|:------------------:|
| Rails 3.2 | :heavy_check_mark: | :x: | :x: | :x: | :x: | :x: |
| Rails 4.2 | :heavy_check_mark: | :heavy_check_mark: | :x: | :x: | :x: | :x: |
| Rails 5.2 | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :x: | :x: | :x: |
| Rails 6.1 | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :x: |
| Rails 7.0 | :x: | :x: | :x: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
| Rails 7.1 | :x: | :x: | :x: | :x: | :heavy_check_mark: | :heavy_check_mark: |
| Rails 7.2 | :x: | :x: | :x: | :x: | :heavy_check_mark: | :heavy_check_mark: |


Later versions might work, earlier will not.

For Rails 2.3 and Ruby 1.8.7 support, use a version < 0.6.

Expand Down
4 changes: 3 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ end
def each_rails_version
Dir['spec/rails-*'].sort.each do |directory|
rails_version = /spec\/rails-(\d+\.\d+)/.match(directory)[1].to_f
if rails_version >= 7.0 && RUBY_VERSION < "2.7.0"
if rails_version >= 7.2 && RUBY_VERSION < "3.1.0"
puts "Skipping #{directory} since rails 7.2+ is not supported on ruby #{RUBY_VERSION}"
elsif rails_version >= 7.0 && RUBY_VERSION < "2.7.0"
puts "Skipping #{directory} since rails 7+ is not supported on ruby #{RUBY_VERSION}"
elsif rails_version < 5.0 && RUBY_VERSION >= "2.7.0"
puts "Skipping #{directory} since rails < 5 is not supported on ruby #{RUBY_VERSION}"
Expand Down
2 changes: 1 addition & 1 deletion spec/rails-3.2/Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
source 'http://rubygems.org'
source 'https://rubygems.org'

gem 'sqlite3'
gem 'rails', '~>3.2'
Expand Down
2 changes: 1 addition & 1 deletion spec/rails-3.2/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ PATH
query_diet (0.7.2)

GEM
remote: http://rubygems.org/
remote: https://rubygems.org/
specs:
actionmailer (3.2.22.1)
actionpack (= 3.2.22.1)
Expand Down
2 changes: 1 addition & 1 deletion spec/rails-3.2/config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Bundler.require(:default, Rails.env) if defined?(Bundler)


module HasDefaultSpecApp
module QueryDietSpecApp
class Application < Rails::Application
config.encoding = "utf-8"

Expand Down
2 changes: 1 addition & 1 deletion spec/rails-3.2/config/environment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
require File.expand_path('../application', __FILE__)

# Initialize the rails application
HasDefaultSpecApp::Application.initialize!
QueryDietSpecApp::Application.initialize!
2 changes: 1 addition & 1 deletion spec/rails-3.2/config/environments/test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
HasDefaultSpecApp::Application.configure do
QueryDietSpecApp::Application.configure do
# Settings specified here will take precedence over those in config/application.rb

# The test environment is used exclusively to run your application's
Expand Down
2 changes: 1 addition & 1 deletion spec/rails-3.2/config/initializers/secret_token.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
HasDefaultSpecApp::Application.config.secret_token = 'cb014a08a45243e7143f31e04774c342c1fba329fd594ae1a480d8283b1a851f425dc08044311fb4be6d000b6e6681de7c76d19148419a5ffa0a9f84556d3b33'
QueryDietSpecApp::Application.config.secret_token = 'cb014a08a45243e7143f31e04774c342c1fba329fd594ae1a480d8283b1a851f425dc08044311fb4be6d000b6e6681de7c76d19148419a5ffa0a9f84556d3b33'
4 changes: 2 additions & 2 deletions spec/rails-3.2/config/initializers/session_store.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Be sure to restart your server when you modify this file.

HasDefaultSpecApp::Application.config.session_store :cookie_store, :key => '_app_root_session'
QueryDietSpecApp::Application.config.session_store :cookie_store, :key => '_app_root_session'

# Use the database for sessions instead of the cookie-based default,
# which shouldn't be used to store highly confidential information
# (create the session table with "rails generate session_migration")
# HasDefaultSpecApp::Application.config.session_store :active_record_store
# QueryDietSpecApp::Application.config.session_store :active_record_store
2 changes: 1 addition & 1 deletion spec/rails-3.2/config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
HasDefaultSpecApp::Application.routes.draw do
QueryDietSpecApp::Application.routes.draw do
# The priority is based upon order of creation:
# first created -> highest priority.

Expand Down
2 changes: 1 addition & 1 deletion spec/rails-4.2/Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
source 'http://rubygems.org'
source 'https://rubygems.org'

gem 'sqlite3', '~>1.3.6'
gem 'rails', '=4.2.11.3'
Expand Down
2 changes: 1 addition & 1 deletion spec/rails-4.2/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ PATH
query_diet (0.7.2)

GEM
remote: http://rubygems.org/
remote: https://rubygems.org/
specs:
actionmailer (4.2.11.3)
actionpack (= 4.2.11.3)
Expand Down
2 changes: 1 addition & 1 deletion spec/rails-4.2/config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
Bundler.require(:default, Rails.env) if defined?(Bundler)


module HasDefaultSpecApp
module QueryDietSpecApp
class Application < Rails::Application
config.encoding = "utf-8"

Expand Down
2 changes: 1 addition & 1 deletion spec/rails-4.2/config/environment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
require File.expand_path('../application', __FILE__)

# Initialize the rails application
HasDefaultSpecApp::Application.initialize!
QueryDietSpecApp::Application.initialize!
2 changes: 1 addition & 1 deletion spec/rails-4.2/config/environments/test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
HasDefaultSpecApp::Application.configure do
QueryDietSpecApp::Application.configure do
# Settings specified here will take precedence over those in config/application.rb

# The test environment is used exclusively to run your application's
Expand Down
2 changes: 1 addition & 1 deletion spec/rails-4.2/config/initializers/secret_token.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
HasDefaultSpecApp::Application.config.secret_token = 'cb014a08a45243e7143f31e04774c342c1fba329fd594ae1a480d8283b1a851f425dc08044311fb4be6d000b6e6681de7c76d19148419a5ffa0a9f84556d3b33'
QueryDietSpecApp::Application.config.secret_token = 'cb014a08a45243e7143f31e04774c342c1fba329fd594ae1a480d8283b1a851f425dc08044311fb4be6d000b6e6681de7c76d19148419a5ffa0a9f84556d3b33'
4 changes: 2 additions & 2 deletions spec/rails-4.2/config/initializers/session_store.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Be sure to restart your server when you modify this file.

HasDefaultSpecApp::Application.config.session_store :cookie_store, :key => '_app_root_session'
QueryDietSpecApp::Application.config.session_store :cookie_store, :key => '_app_root_session'

# Use the database for sessions instead of the cookie-based default,
# which shouldn't be used to store highly confidential information
# (create the session table with "rails generate session_migration")
# HasDefaultSpecApp::Application.config.session_store :active_record_store
# QueryDietSpecApp::Application.config.session_store :active_record_store
2 changes: 1 addition & 1 deletion spec/rails-4.2/config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
HasDefaultSpecApp::Application.routes.draw do
QueryDietSpecApp::Application.routes.draw do
# The priority is based upon order of creation:
# first created -> highest priority.

Expand Down
2 changes: 1 addition & 1 deletion spec/rails-5.2/Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
source 'http://rubygems.org'
source 'https://rubygems.org'

gem 'sqlite3'
gem 'rails', '=5.2.4.4'
Expand Down
2 changes: 1 addition & 1 deletion spec/rails-5.2/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ PATH
query_diet (0.7.2)

GEM
remote: http://rubygems.org/
remote: https://rubygems.org/
specs:
actioncable (5.2.4.4)
actionpack (= 5.2.4.4)
Expand Down
2 changes: 1 addition & 1 deletion spec/rails-5.2/config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
Bundler.require(:default, Rails.env) if defined?(Bundler)


module HasDefaultSpecApp
module QueryDietSpecApp
class Application < Rails::Application
config.encoding = "utf-8"

Expand Down
2 changes: 1 addition & 1 deletion spec/rails-5.2/config/environment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
require File.expand_path('../application', __FILE__)

# Initialize the rails application
HasDefaultSpecApp::Application.initialize!
QueryDietSpecApp::Application.initialize!
2 changes: 1 addition & 1 deletion spec/rails-5.2/config/environments/test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
HasDefaultSpecApp::Application.configure do
QueryDietSpecApp::Application.configure do
# Settings specified here will take precedence over those in config/application.rb

# The test environment is used exclusively to run your application's
Expand Down
4 changes: 2 additions & 2 deletions spec/rails-5.2/config/initializers/session_store.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Be sure to restart your server when you modify this file.

HasDefaultSpecApp::Application.config.session_store :cookie_store, :key => '_app_root_session'
QueryDietSpecApp::Application.config.session_store :cookie_store, :key => '_app_root_session'

# Use the database for sessions instead of the cookie-based default,
# which shouldn't be used to store highly confidential information
# (create the session table with "rails generate session_migration")
# HasDefaultSpecApp::Application.config.session_store :active_record_store
# QueryDietSpecApp::Application.config.session_store :active_record_store
2 changes: 1 addition & 1 deletion spec/rails-5.2/config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
HasDefaultSpecApp::Application.routes.draw do
QueryDietSpecApp::Application.routes.draw do
# The priority is based upon order of creation:
# first created -> highest priority.

Expand Down
5 changes: 4 additions & 1 deletion spec/rails-6.1/Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
source 'http://rubygems.org'
source 'https://rubygems.org'

gem 'sqlite3'
gem 'rails', '=6.1.2.1'
Expand All @@ -7,3 +7,6 @@ gem 'rspec-rails'
gem 'database_cleaner'
gem 'query_diet', :path => '../..'
gem 'capybara'
# For Ruby 3.1.1
gem 'matrix'
gem 'net-smtp'
24 changes: 16 additions & 8 deletions spec/rails-6.1/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ PATH
query_diet (0.7.2)

GEM
remote: http://rubygems.org/
remote: https://rubygems.org/
specs:
actioncable (6.1.2.1)
actionpack (= 6.1.2.1)
Expand Down Expand Up @@ -86,8 +86,8 @@ GEM
database_cleaner-core (2.0.1)
diff-lcs (1.4.4)
erubi (1.10.0)
globalid (0.4.2)
activesupport (>= 4.2.0)
globalid (1.0.0)
activesupport (>= 5.0)
i18n (1.8.9)
concurrent-ruby (~> 1.0)
loofah (2.9.0)
Expand All @@ -97,19 +97,24 @@ GEM
mini_mime (>= 0.1.1)
marcel (0.3.3)
mimemagic (~> 0.3.2)
matrix (0.4.2)
method_source (1.0.0)
mimemagic (0.3.10)
nokogiri (~> 1)
rake
mini_mime (1.0.2)
mini_portile2 (2.5.0)
mini_portile2 (2.8.7)
minitest (5.14.4)
net-protocol (0.2.2)
timeout
net-smtp (0.5.0)
net-protocol
nio4r (2.5.7)
nokogiri (1.11.2)
mini_portile2 (~> 2.5.0)
nokogiri (1.13.10)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
public_suffix (4.0.6)
racc (1.5.2)
racc (1.8.1)
rack (2.2.3)
rack-test (1.1.0)
rack (>= 1.0, < 3)
Expand Down Expand Up @@ -171,6 +176,7 @@ GEM
sprockets (>= 3.0.0)
sqlite3 (1.4.2)
thor (1.1.0)
timeout (0.4.1)
tzinfo (2.0.4)
concurrent-ruby (~> 1.0)
websocket-driver (0.7.3)
Expand All @@ -186,11 +192,13 @@ PLATFORMS
DEPENDENCIES
capybara
database_cleaner
matrix
net-smtp
query_diet!
rails (= 6.1.2.1)
rspec
rspec-rails
sqlite3

BUNDLED WITH
2.2.3
2.5.17
2 changes: 1 addition & 1 deletion spec/rails-6.1/config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
Bundler.require(:default, Rails.env) if defined?(Bundler)


module HasDefaultSpecApp
module QueryDietSpecApp
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 6.1
Expand Down
2 changes: 1 addition & 1 deletion spec/rails-6.1/config/environment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
require File.expand_path('../application', __FILE__)

# Initialize the rails application
HasDefaultSpecApp::Application.initialize!
QueryDietSpecApp::Application.initialize!
2 changes: 1 addition & 1 deletion spec/rails-6.1/config/environments/test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
HasDefaultSpecApp::Application.configure do
QueryDietSpecApp::Application.configure do
# Settings specified here will take precedence over those in config/application.rb

# The test environment is used exclusively to run your application's
Expand Down
4 changes: 2 additions & 2 deletions spec/rails-6.1/config/initializers/session_store.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Be sure to restart your server when you modify this file.

HasDefaultSpecApp::Application.config.session_store :cookie_store, :key => '_app_root_session'
QueryDietSpecApp::Application.config.session_store :cookie_store, :key => '_app_root_session'

# Use the database for sessions instead of the cookie-based default,
# which shouldn't be used to store highly confidential information
# (create the session table with "rails generate session_migration")
# HasDefaultSpecApp::Application.config.session_store :active_record_store
# QueryDietSpecApp::Application.config.session_store :active_record_store
2 changes: 1 addition & 1 deletion spec/rails-6.1/config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
HasDefaultSpecApp::Application.routes.draw do
QueryDietSpecApp::Application.routes.draw do
# The priority is based upon order of creation:
# first created -> highest priority.

Expand Down
2 changes: 1 addition & 1 deletion spec/rails-7.0/Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
source 'http://rubygems.org'
source 'https://rubygems.org'

gem 'sqlite3'
gem 'rails', '=7.0.1'
Expand Down
Loading
Loading