Commit f7c2aada authored by ng's avatar ng

Merge branch 'paz/no-factory-bot-in-migration-specs' into 'master'

Don't use FactoryBot in migration specs.

Closes #447

See merge request !326
parents 50eecf4a f6db1de7
Pipeline #36727 passed with stages
in 14 minutes and 10 seconds
......@@ -24,7 +24,7 @@ describe 'AddSigEncToHeadersToMetaDefaults' do
it 'adds sig and enc to headers_to_meta for lists without the attributes' do
ActiveRecord::Migrator.migrate(migrations_paths, previous_migration)
list_klass = create_list_klass
list = create(:list, headers_to_meta: list_klass.column_defaults['headers_to_meta'])
list = list_klass.create!(headers_to_meta: list_klass.column_defaults['headers_to_meta'])
expect(list.headers_to_meta).not_to include('enc', 'sig')
......@@ -39,7 +39,7 @@ describe 'AddSigEncToHeadersToMetaDefaults' do
headers_to_meta_including_sig_and_enc = ["from", "to", "cc", "date", "sig", "enc"]
ActiveRecord::Migrator.migrate(migrations_paths, previous_migration)
list_klass = create_list_klass
list = create(:list, headers_to_meta: headers_to_meta_including_sig_and_enc)
list = list_klass.create!(headers_to_meta: headers_to_meta_including_sig_and_enc)
expect(list.headers_to_meta).to eql headers_to_meta_including_sig_and_enc
......@@ -67,7 +67,7 @@ describe 'AddSigEncToHeadersToMetaDefaults' do
ActiveRecord::Migrator.migrate(migrations_paths, migration_under_test)
list_klass = create_list_klass
list_klass.reset_column_information
list = create(:list, headers_to_meta: list_klass.column_defaults['headers_to_meta'])
list = list_klass.create!(headers_to_meta: list_klass.column_defaults['headers_to_meta'])
expect(list.headers_to_meta).to include('enc', 'sig')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment