2018-03-01 23:46:02 +00:00
|
|
|
shared_examples 'cluster application core specs' do |application_name|
|
|
|
|
it { is_expected.to belong_to(:cluster) }
|
|
|
|
it { is_expected.to validate_presence_of(:cluster) }
|
|
|
|
|
2019-04-12 05:42:48 +00:00
|
|
|
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
|
|
|
|
|
2018-03-01 23:46:02 +00:00
|
|
|
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
|