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

Fix test deprecation warnings #1018

Merged
merged 4 commits into from
Aug 9, 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
3 changes: 3 additions & 0 deletions spec/dummy/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ class Application < Rails::Application
config.action_controller.perform_caching = false
config.action_mailer.default_url_options = { host: "dummy.example.com" }
config.action_mailer.delivery_method = :test
if Rails.version.match?(/(6.1|7.0)/)
config.active_record.legacy_connection_handling = false
end
config.active_support.deprecation = :stderr
config.eager_load = false

Expand Down
14 changes: 9 additions & 5 deletions spec/generators/clearance/install/install_generator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
require "generators/clearance/install/install_generator"

describe Clearance::Generators::InstallGenerator, :generator do
def get_migration(path)
Pathname.new(migration_file(path))
end

describe "initializer" do
it "is copied to the application" do
provide_existing_application_controller
Expand Down Expand Up @@ -66,7 +70,7 @@
table_does_not_exist(:users)

run_generator
migration = migration_file("db/migrate/create_users.rb")
migration = get_migration("db/migrate/create_users.rb")

expect(migration).to exist
expect(migration).to have_correct_syntax
Expand All @@ -88,7 +92,7 @@
table_does_not_exist(:users)

run_generator
migration = migration_file("db/migrate/create_users.rb")
migration = get_migration("db/migrate/create_users.rb")

expect(migration).to exist
expect(migration).to have_correct_syntax
Expand All @@ -102,8 +106,8 @@
provide_existing_application_controller

run_generator
create_migration = migration_file("db/migrate/create_users.rb")
add_migration = migration_file("db/migrate/add_clearance_to_users.rb")
create_migration = get_migration("db/migrate/create_users.rb")
add_migration = get_migration("db/migrate/add_clearance_to_users.rb")

expect(create_migration).not_to exist
expect(add_migration).not_to exist
Expand All @@ -126,7 +130,7 @@
and_return(existing_indexes)

run_generator
migration = migration_file("db/migrate/add_clearance_to_users.rb")
migration = get_migration("db/migrate/add_clearance_to_users.rb")

expect(migration).to exist
expect(migration).to have_correct_syntax
Expand Down
Loading