diff --git a/spec/migrations/update_authorized_keys_file_spec.rb b/spec/migrations/update_authorized_keys_file_spec.rb index c5350594fd433912de9330870c643a38ec934e51..4a8719582b8254427a792e6e170679a9fee486b0 100644 --- a/spec/migrations/update_authorized_keys_file_spec.rb +++ b/spec/migrations/update_authorized_keys_file_spec.rb @@ -11,13 +11,13 @@ ActiveRecord::Base.connection.change_column_null :application_settings, :authorized_keys_enabled, true ActiveRecord::Base.connection.change_column :application_settings, :authorized_keys_enabled, :boolean, default: nil - ApplicationSetting.create!(authorized_keys_enabled: nil, mirror_max_delay: 300) + described_class::ApplicationSetting.create!(authorized_keys_enabled: nil) end it 'sets authorized_keys_enabled to true' do migration.up - expect(ApplicationSetting.last.authorized_keys_enabled).to be_truthy + expect(described_class::ApplicationSetting.last.authorized_keys_enabled).to be_truthy end context 'there are keys created before and after the cutoff datetime' do @@ -83,11 +83,11 @@ end context 'when is a record in application_settings table' do - before do - ApplicationSetting.create!(authorized_keys_enabled: true, mirror_max_delay: 300) - end - context 'when authorized_keys_enabled is true' do + before do + described_class::ApplicationSetting.create!(authorized_keys_enabled: true) + end + it { is_expected.to be_truthy } end @@ -97,7 +97,7 @@ ActiveRecord::Base.connection.change_column_null :application_settings, :authorized_keys_enabled, true ActiveRecord::Base.connection.change_column :application_settings, :authorized_keys_enabled, :boolean, default: nil - ApplicationSetting.first.update(authorized_keys_enabled: nil, mirror_max_delay: 300) + described_class::ApplicationSetting.create!(authorized_keys_enabled: nil) end it { is_expected.to be_truthy } @@ -105,7 +105,7 @@ context 'when authorized_keys_enabled is explicitly false' do before do - ApplicationSetting.first.update!(authorized_keys_enabled: false, mirror_max_delay: 300) + described_class::ApplicationSetting.create!(authorized_keys_enabled: false) end it { is_expected.to be_falsey } @@ -118,7 +118,7 @@ context 'when there is no record in application_settings table' do before do - expect(ApplicationSetting.count).to eq(0) + expect(described_class::ApplicationSetting.count).to eq(0) end it { is_expected.to be_falsey }