Methods
- S
- T
-
- test_create_and_drop_join_table_with_common_prefix,
- test_create_join_table,
- test_create_join_table_set_not_null_by_default,
- test_create_join_table_with_column_options,
- test_create_join_table_with_index,
- test_create_join_table_with_strings,
- test_create_join_table_with_symbol_and_string,
- test_create_join_table_with_the_proper_order,
- test_create_join_table_with_the_table_name,
- test_create_join_table_with_the_table_name_as_string,
- test_create_join_table_without_indexes,
- test_drop_join_table,
- test_drop_join_table_with_column_options,
- test_drop_join_table_with_strings,
- test_drop_join_table_with_the_proper_order,
- test_drop_join_table_with_the_table_name,
- test_drop_join_table_with_the_table_name_as_string
Attributes
| [R] | connection |
Instance Public methods
setup()
Link
test_create_and_drop_join_table_with_common_prefix()
Link
# File activerecord/test/cases/migration/create_join_table_test.rb, line 123 def test_create_and_drop_join_table_with_common_prefix with_table_cleanup do connection.create_join_table 'audio_artists', 'audio_musics' assert_includes connection.tables, 'audio_artists_musics' connection.drop_join_table 'audio_artists', 'audio_musics' assert !connection.tables.include?('audio_artists_musics'), "Should have dropped join table, but didn't" end end
test_create_join_table()
Link
test_create_join_table_set_not_null_by_default()
Link
test_create_join_table_with_column_options()
Link
# File activerecord/test/cases/migration/create_join_table_test.rb, line 61 def test_create_join_table_with_column_options connection.create_join_table :artists, :musics, column_options: {null: true} assert_equal [true, true], connection.columns(:artists_musics).map(&:null) end
test_create_join_table_with_index()
Link
# File activerecord/test/cases/migration/create_join_table_test.rb, line 73 def test_create_join_table_with_index connection.create_join_table :artists, :musics do |t| t.index [:artist_id, :music_id] end assert_equal [%w(artist_id music_id)], connection.indexes(:artists_musics).map(&:columns) end
test_create_join_table_with_strings()
Link
test_create_join_table_with_symbol_and_string()
Link
test_create_join_table_with_the_proper_order()
Link
test_create_join_table_with_the_table_name()
Link
# File activerecord/test/cases/migration/create_join_table_test.rb, line 49 def test_create_join_table_with_the_table_name connection.create_join_table :artists, :musics, table_name: :catalog assert_equal %w(artist_id music_id), connection.columns(:catalog).map(&:name).sort end
test_create_join_table_with_the_table_name_as_string()
Link
# File activerecord/test/cases/migration/create_join_table_test.rb, line 55 def test_create_join_table_with_the_table_name_as_string connection.create_join_table :artists, :musics, table_name: 'catalog' assert_equal %w(artist_id music_id), connection.columns(:catalog).map(&:name).sort end
test_create_join_table_without_indexes()
Link
test_drop_join_table()
Link
test_drop_join_table_with_column_options()
Link
# File activerecord/test/cases/migration/create_join_table_test.rb, line 116 def test_drop_join_table_with_column_options connection.create_join_table :artists, :musics, column_options: {null: true} connection.drop_join_table :artists, :musics, column_options: {null: true} assert !connection.tables.include?('artists_musics') end
test_drop_join_table_with_strings()
Link
test_drop_join_table_with_the_proper_order()
Link
test_drop_join_table_with_the_table_name()
Link
# File activerecord/test/cases/migration/create_join_table_test.rb, line 102 def test_drop_join_table_with_the_table_name connection.create_join_table :artists, :musics, table_name: :catalog connection.drop_join_table :artists, :musics, table_name: :catalog assert !connection.tables.include?('catalog') end
test_drop_join_table_with_the_table_name_as_string()
Link
# File activerecord/test/cases/migration/create_join_table_test.rb, line 109 def test_drop_join_table_with_the_table_name_as_string connection.create_join_table :artists, :musics, table_name: 'catalog' connection.drop_join_table :artists, :musics, table_name: 'catalog' assert !connection.tables.include?('catalog') end