From 1ead23026ea3b57f1316f3244c19ebf352780b92 Mon Sep 17 00:00:00 2001 From: Vladislav Sokov Date: Fri, 19 Jul 2024 10:21:00 +0300 Subject: [PATCH] fixup! fix tests --- .../actual_db_schema/migrations_controller_test.rb | 4 ++-- .../phantom_migrations_controller_test.rb | 4 ++-- test/dummy_app/config/database.yml | 11 +++-------- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/test/controllers/actual_db_schema/migrations_controller_test.rb b/test/controllers/actual_db_schema/migrations_controller_test.rb index 609e6f2..65e2887 100644 --- a/test/controllers/actual_db_schema/migrations_controller_test.rb +++ b/test/controllers/actual_db_schema/migrations_controller_test.rb @@ -135,8 +135,8 @@ def down post :rollback, params: { id: "20130906111513", database: "tmp/primary.sqlite3" } assert_response :redirect get :index - assert_select ".flash", - text: "An error has occurred, this and all later migrations canceled:\n\nActiveRecord::IrreversibleMigration" + message = "An error has occurred, this and all later migrations canceled:\n\nActiveRecord::IrreversibleMigration" + assert_select ".flash", text: message end end end diff --git a/test/controllers/actual_db_schema/phantom_migrations_controller_test.rb b/test/controllers/actual_db_schema/phantom_migrations_controller_test.rb index 502c888..5fc3532 100644 --- a/test/controllers/actual_db_schema/phantom_migrations_controller_test.rb +++ b/test/controllers/actual_db_schema/phantom_migrations_controller_test.rb @@ -155,8 +155,8 @@ def down post :rollback, params: { id: "20130906111513", database: "tmp/primary.sqlite3" } assert_response :redirect get :index - assert_select ".flash", - text: "An error has occurred, this and all later migrations canceled:\n\nActiveRecord::IrreversibleMigration" + message = "An error has occurred, this and all later migrations canceled:\n\nActiveRecord::IrreversibleMigration" + assert_select ".flash", text: message end test "POST #rollback_all changes all phantom migrations status to down and hide migration with down status" do diff --git a/test/dummy_app/config/database.yml b/test/dummy_app/config/database.yml index e804c7c..b7c49e3 100644 --- a/test/dummy_app/config/database.yml +++ b/test/dummy_app/config/database.yml @@ -1,10 +1,5 @@ --- test: - primary: - adapter: sqlite3 - database: tmp/primary.sqlite3 - migrations_paths: "/home/vlad/projects/actual_db_schema/test/dummy_app/db/migrate" - secondary: - adapter: sqlite3 - database: tmp/secondary.sqlite3 - migrations_paths: "/home/vlad/projects/actual_db_schema/test/dummy_app/db/migrate_secondary" + adapter: sqlite3 + database: tmp/primary.sqlite3 + migrations_paths: "/home/vlad/projects/actual_db_schema/test/dummy_app/db/migrate"