@@ -178,24 +178,20 @@ def test_schema_dump_with_regexp_ignored_table
178178 end
179179
180180 def test_schema_dumps_index_columns_in_right_order
181- index_definition = standard_dump . split ( /\n / ) . grep ( /t\. index.*company_index/ ) . first . strip
181+ index_definition = dump_table_schema ( "companies" ) . split ( /\n / ) . grep ( /t\. index.*company_index/ ) . first . strip
182182 if current_adapter? ( :PostgreSQLAdapter )
183- assert_equal 't.index ["firm_id", "type", "rating"], name: "company_index", order: { rating: :desc }, using: :btree ' , index_definition
183+ assert_equal 't.index ["firm_id", "type", "rating"], name: "company_index", order: { rating: :desc }' , index_definition
184184 elsif current_adapter? ( :Mysql2Adapter )
185- assert_equal 't.index ["firm_id", "type", "rating"], name: "company_index", length: { type: 10 }, using: :btree ' , index_definition
185+ assert_equal 't.index ["firm_id", "type", "rating"], name: "company_index", length: { type: 10 }' , index_definition
186186 else
187187 assert_equal 't.index ["firm_id", "type", "rating"], name: "company_index"' , index_definition
188188 end
189189 end
190190
191191 def test_schema_dumps_partial_indices
192- index_definition = standard_dump . split ( /\n / ) . grep ( /t\. index.*company_partial_index/ ) . first . strip
193- if current_adapter? ( :PostgreSQLAdapter )
194- assert_equal 't.index ["firm_id", "type"], name: "company_partial_index", where: "(rating > 10)", using: :btree' , index_definition
195- elsif current_adapter? ( :Mysql2Adapter )
196- assert_equal 't.index ["firm_id", "type"], name: "company_partial_index", using: :btree' , index_definition
197- elsif current_adapter? ( :SQLite3Adapter ) && ActiveRecord ::Base . connection . supports_partial_index?
198- assert_equal 't.index ["firm_id", "type"], name: "company_partial_index", where: "rating > 10"' , index_definition
192+ index_definition = dump_table_schema ( "companies" ) . split ( /\n / ) . grep ( /t\. index.*company_partial_index/ ) . first . strip
193+ if current_adapter? ( :PostgreSQLAdapter , :SQLite3Adapter ) && ActiveRecord ::Base . connection . supports_partial_index?
194+ assert_equal 't.index ["firm_id", "type"], name: "company_partial_index", where: "(rating > 10)"' , index_definition
199195 else
200196 assert_equal 't.index ["firm_id", "type"], name: "company_partial_index"' , index_definition
201197 end
@@ -248,9 +244,9 @@ def test_schema_does_not_include_limit_for_emulated_mysql_boolean_fields
248244 end
249245
250246 def test_schema_dumps_index_type
251- output = standard_dump
252- assert_match %r{t\. index \[ "awesome"\] , name: "index_key_tests_on_awesome", type: :fulltext} , output
253- assert_match %r{t\. index \[ "pizza"\] , name: "index_key_tests_on_pizza", using: :btree } , output
247+ output = dump_table_schema "key_tests"
248+ assert_match %r{t\. index \[ "awesome"\] , name: "index_key_tests_on_awesome", type: :fulltext$ } , output
249+ assert_match %r{t\. index \[ "pizza"\] , name: "index_key_tests_on_pizza"$ } , output
254250 end
255251 end
256252
@@ -277,7 +273,7 @@ def test_schema_dump_allows_array_of_decimal_defaults
277273
278274 def test_schema_dump_expression_indices
279275 index_definition = dump_table_schema ( "companies" ) . split ( /\n / ) . grep ( /t\. index.*company_expression_index/ ) . first . strip
280- assert_equal 't.index "lower((name)::text)", name: "company_expression_index", using: :btree ' , index_definition
276+ assert_equal 't.index "lower((name)::text)", name: "company_expression_index"' , index_definition
281277 end
282278
283279 def test_schema_dump_interval_type
0 commit comments