diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-17 21:08:29 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-17 21:08:29 +0000 |
commit | 40254b9ace2a74a3c9f1cc51a1b1d5e3e78c1ae9 (patch) | |
tree | 9b735ef933178be36d35088f3acab2d9b75dbbad /spec/models | |
parent | 22a0d312ae82e7dda3073d5d1a5a766d7641738d (diff) | |
download | gitlab-ce-40254b9ace2a74a3c9f1cc51a1b1d5e3e78c1ae9.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/import_failure_spec.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/spec/models/import_failure_spec.rb b/spec/models/import_failure_spec.rb new file mode 100644 index 00000000000..d6574791a65 --- /dev/null +++ b/spec/models/import_failure_spec.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe ImportFailure do + describe "Associations" do + it { is_expected.to belong_to(:project) } + it { is_expected.to belong_to(:group) } + end + + describe 'Validations' do + context 'has no group' do + before do + allow(subject).to receive(:group).and_return(nil) + end + + it { is_expected.to validate_presence_of(:project) } + end + + context 'has no project' do + before do + allow(subject).to receive(:project).and_return(nil) + end + + it { is_expected.to validate_presence_of(:group) } + end + end +end |