Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cluster_application_core_shared_examples.rb « models « shared_examples « support « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d6490a808ce1ac3e54d3fa42a73697ffc1d97184 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
shared_examples 'cluster application core specs' do |application_name|
  it { is_expected.to belong_to(:cluster) }
  it { is_expected.to validate_presence_of(:cluster) }

  describe '#can_uninstall?' do
    it 'calls allowed_to_uninstall?' do
      expect(subject).to receive(:allowed_to_uninstall?).and_return(true)

      expect(subject.can_uninstall?).to be_truthy
    end
  end

  describe '#name' do
    it 'is .application_name' do
      expect(subject.name).to eq(described_class.application_name)
    end

    it 'is recorded in Clusters::Cluster::APPLICATIONS' do
      expect(Clusters::Cluster::APPLICATIONS[subject.name]).to eq(described_class)
    end
  end
end