Skip to content

Commit a766ced

Browse files
committed
Test with released Rails 7
1 parent 2988f37 commit a766ced

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
fail-fast: false
88
matrix:
99
ruby: [ '2.7', '3.0.2', 'head' ]
10-
rails: [ '6.0', '6.1', 'edge' ]
10+
rails: [ '6.0', '6.1', '7.0', 'edge' ]
1111

1212
env:
1313
RAILS_VERSION: ${{ matrix.rails }}

Gemfile

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ gemspec
55

66
if ENV["RAILS_VERSION"] == "edge"
77
gem "activesupport", github: "rails/rails", branch: "main"
8+
elsif ENV['RAILS_VERSION'] == "7.0"
9+
gem "activesupport", ">= 7.0.0.alpha"
10+
">= 7.0.0.alpha"
811
elsif ENV["RAILS_VERSION"]
9-
gem "activesupport", "~> #{ENV["RAILS_VERSION"] || "6.1"}.0"
12+
gem "activesupport", "~> #{ENV["RAILS_VERSION"]}.0"
1013
end

test/support/acceptance_test.rb

+7-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ class AcceptanceTest < ActiveSupport::TestCase
1212

1313
def rails_version
1414
if ENV['RAILS_VERSION'] == "edge"
15-
"7.0.0.alpha"
15+
"7.1.0.alpha"
16+
elsif ENV['RAILS_VERSION'] == "7.0"
17+
">= 7.0.0.alpha"
1618
else
1719
"~> #{ENV['RAILS_VERSION'] || "6.1"}.0"
1820
end
@@ -157,7 +159,7 @@ def without_gem(name)
157159
end
158160

159161
test "code changes in pre-referenced app files are picked up" do
160-
File.write(app.path("config/initializers/load_posts_controller.rb"), "PostsController\n")
162+
File.write(app.path("config/initializers/load_posts_controller.rb"), "Rails.application.config.to_prepare { PostsController }\n")
161163

162164
assert_speedup do
163165
assert_success app.spring_test_command, stdout: "0 failures"
@@ -519,7 +521,8 @@ def exec_name
519521
test "changing the Gemfile works" do
520522
assert_success %(bin/rails runner 'require "sqlite3"')
521523

522-
File.write(app.gemfile, app.gemfile.read.gsub(%{gem 'sqlite3'}, %{# gem 'sqlite3'}))
524+
File.write(app.gemfile, app.gemfile.read.gsub(%r{gem ['"]sqlite3['"]}, %{# gem "sqlite3"}))
525+
puts app.gemfile.read
523526
app.await_reload
524527

525528
assert_failure %(bin/rails runner 'require "sqlite3"'), stderr: "sqlite3"
@@ -531,7 +534,7 @@ def exec_name
531534

532535
assert_success %(bin/rails runner 'require "sqlite3"')
533536

534-
File.write(app.gems_rb, app.gems_rb.read.sub(%{gem 'sqlite3'}, %{# gem 'sqlite3'}))
537+
File.write(app.gems_rb, app.gems_rb.read.gsub(%r{gem ['"]sqlite3['"]}, %{# gem "sqlite3"}))
535538
app.await_reload
536539

537540
assert_failure %(bin/rails runner 'require "sqlite3"'), stderr: "sqlite3"

0 commit comments

Comments
 (0)