2020-10-15 11:08:45 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
RSpec.describe BulkImport, type: :model do
|
|
|
|
describe 'associations' do
|
|
|
|
it { is_expected.to belong_to(:user).required }
|
|
|
|
it { is_expected.to have_one(:configuration) }
|
|
|
|
it { is_expected.to have_many(:entities) }
|
|
|
|
end
|
|
|
|
|
|
|
|
describe 'validations' do
|
|
|
|
it { is_expected.to validate_presence_of(:source_type) }
|
|
|
|
it { is_expected.to validate_presence_of(:status) }
|
|
|
|
|
|
|
|
it { is_expected.to define_enum_for(:source_type).with_values(%i[gitlab]) }
|
|
|
|
end
|
2021-07-05 08:08:33 -04:00
|
|
|
|
|
|
|
describe '.all_human_statuses' do
|
|
|
|
it 'returns all human readable entity statuses' do
|
|
|
|
expect(described_class.all_human_statuses).to contain_exactly('created', 'started', 'finished', 'failed')
|
|
|
|
end
|
|
|
|
end
|
2020-10-15 11:08:45 -04:00
|
|
|
end
|