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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/metrics/dashboard/annotation_spec.rb')
-rw-r--r--spec/models/metrics/dashboard/annotation_spec.rb39
1 files changed, 0 insertions, 39 deletions
diff --git a/spec/models/metrics/dashboard/annotation_spec.rb b/spec/models/metrics/dashboard/annotation_spec.rb
index 9b8601e4052..7c4f392fcdc 100644
--- a/spec/models/metrics/dashboard/annotation_spec.rb
+++ b/spec/models/metrics/dashboard/annotation_spec.rb
@@ -5,11 +5,6 @@ require 'spec_helper'
RSpec.describe Metrics::Dashboard::Annotation do
using RSpec::Parameterized::TableSyntax
- describe 'associations' do
- it { is_expected.to belong_to(:environment).inverse_of(:metrics_dashboard_annotations) }
- it { is_expected.to belong_to(:cluster).class_name('Clusters::Cluster').inverse_of(:metrics_dashboard_annotations) }
- end
-
describe 'validation' do
it { is_expected.to validate_presence_of(:description) }
it { is_expected.to validate_presence_of(:dashboard_path) }
@@ -18,18 +13,6 @@ RSpec.describe Metrics::Dashboard::Annotation do
it { is_expected.to validate_length_of(:panel_xid).is_at_most(255) }
it { is_expected.to validate_length_of(:description).is_at_most(255) }
- context 'orphaned annotation' do
- subject { build(:metrics_dashboard_annotation, environment: nil) }
-
- it { is_expected.not_to be_valid }
-
- it 'reports error about both missing relations' do
- subject.valid?
-
- expect(subject.errors.full_messages).to include(/Annotation must belong to a cluster or an environment/)
- end
- end
-
context 'ending_at_after_starting_at' do
where(:starting_at, :ending_at, :valid?, :message) do
2.days.ago.beginning_of_day | 1.day.ago.beginning_of_day | true | nil
@@ -49,28 +32,6 @@ RSpec.describe Metrics::Dashboard::Annotation do
end
end
end
-
- context 'environments annotation' do
- subject { build(:metrics_dashboard_annotation) }
-
- it { is_expected.to be_valid }
- end
-
- context 'clusters annotation' do
- subject { build(:metrics_dashboard_annotation, :with_cluster) }
-
- it { is_expected.to be_valid }
- end
-
- context 'annotation with shared ownership' do
- subject { build(:metrics_dashboard_annotation, :with_cluster, environment: build(:environment)) }
-
- it 'reports error about both shared ownership' do
- subject.valid?
-
- expect(subject.errors.full_messages).to include(/Annotation can't belong to both a cluster and an environment at the same time/)
- end
- end
end
describe 'scopes' do