summaryrefslogtreecommitdiff
path: root/spec/models/import_failure_spec.rb
blob: d6574791a657fa777f9bd45c28723d349036fa6d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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