diff options
author | Shinya Maeda <shinya@gitlab.com> | 2018-12-04 19:24:21 +0900 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2018-12-04 19:24:21 +0900 |
commit | e1449df7a2eccbdaeb807d60a1c67b249d6ec03e (patch) | |
tree | bdf46ae564f55fd0946d2520c005c18e8e83738e | |
parent | 5b24739eb30b6505ef652b526c7502bd961c5bc2 (diff) | |
download | gitlab-ce-e1449df7a2eccbdaeb807d60a1c67b249d6ec03e.tar.gz |
Fix coding offence
-rw-r--r-- | spec/models/ci/build_metadata_spec.rb | 4 | ||||
-rw-r--r-- | spec/models/ci/build_trace_chunk_spec.rb | 4 | ||||
-rw-r--r-- | spec/models/ci/job_artifact_spec.rb | 4 | ||||
-rw-r--r-- | spec/models/ci/pipeline_spec.rb | 4 | ||||
-rw-r--r-- | spec/models/ci/stage_spec.rb | 4 | ||||
-rw-r--r-- | spec/models/clusters/applications/ingress_spec.rb | 4 | ||||
-rw-r--r-- | spec/models/clusters/platforms/kubernetes_spec.rb | 4 | ||||
-rw-r--r-- | spec/models/commit_status_spec.rb | 4 | ||||
-rw-r--r-- | spec/models/gpg_signature_spec.rb | 4 | ||||
-rw-r--r-- | spec/models/internal_id_spec.rb | 4 | ||||
-rw-r--r-- | spec/models/project_auto_devops_spec.rb | 4 | ||||
-rw-r--r-- | spec/models/prometheus_metric_spec.rb | 4 | ||||
-rw-r--r-- | spec/models/resource_label_event_spec.rb | 4 | ||||
-rw-r--r-- | spec/models/user_callout_spec.rb | 4 |
14 files changed, 28 insertions, 28 deletions
diff --git a/spec/models/ci/build_metadata_spec.rb b/spec/models/ci/build_metadata_spec.rb index 37227469fcc..519968b9e48 100644 --- a/spec/models/ci/build_metadata_spec.rb +++ b/spec/models/ci/build_metadata_spec.rb @@ -1,8 +1,6 @@ require 'spec_helper' describe Ci::BuildMetadata do - it_behaves_like 'having unique enum values' - set(:user) { create(:user) } set(:group) { create(:group, :access_requestable) } set(:project) { create(:project, :repository, group: group, build_timeout: 2000) } @@ -17,6 +15,8 @@ describe Ci::BuildMetadata do let(:build) { create(:ci_build, pipeline: pipeline) } let(:build_metadata) { build.metadata } + it_behaves_like 'having unique enum values' + describe '#update_timeout_state' do subject { build_metadata } diff --git a/spec/models/ci/build_trace_chunk_spec.rb b/spec/models/ci/build_trace_chunk_spec.rb index 86a1f614eea..d214fdf369a 100644 --- a/spec/models/ci/build_trace_chunk_spec.rb +++ b/spec/models/ci/build_trace_chunk_spec.rb @@ -3,8 +3,6 @@ require 'spec_helper' describe Ci::BuildTraceChunk, :clean_gitlab_redis_shared_state do include ExclusiveLeaseHelpers - it_behaves_like 'having unique enum values' - set(:build) { create(:ci_build, :running) } let(:chunk_index) { 0 } let(:data_store) { :redis } @@ -14,6 +12,8 @@ describe Ci::BuildTraceChunk, :clean_gitlab_redis_shared_state do described_class.new(build: build, chunk_index: chunk_index, data_store: data_store, raw_data: raw_data) end + it_behaves_like 'having unique enum values' + before do stub_feature_flags(ci_enable_live_trace: true) stub_artifacts_object_storage diff --git a/spec/models/ci/job_artifact_spec.rb b/spec/models/ci/job_artifact_spec.rb index a5ab577b9b1..c68ba02b8de 100644 --- a/spec/models/ci/job_artifact_spec.rb +++ b/spec/models/ci/job_artifact_spec.rb @@ -1,8 +1,6 @@ require 'spec_helper' describe Ci::JobArtifact do - it_behaves_like 'having unique enum values' - let(:artifact) { create(:ci_job_artifact, :archive) } describe "Associations" do @@ -17,6 +15,8 @@ describe Ci::JobArtifact do it { is_expected.to delegate_method(:open).to(:file) } it { is_expected.to delegate_method(:exists?).to(:file) } + it_behaves_like 'having unique enum values' + describe '.test_reports' do subject { described_class.test_reports } diff --git a/spec/models/ci/pipeline_spec.rb b/spec/models/ci/pipeline_spec.rb index ebde70776ad..3fe351e78d5 100644 --- a/spec/models/ci/pipeline_spec.rb +++ b/spec/models/ci/pipeline_spec.rb @@ -1,8 +1,6 @@ require 'spec_helper' describe Ci::Pipeline, :mailer do - it_behaves_like 'having unique enum values' - let(:user) { create(:user) } set(:project) { create(:project) } @@ -10,6 +8,8 @@ describe Ci::Pipeline, :mailer do create(:ci_empty_pipeline, status: :created, project: project) end + it_behaves_like 'having unique enum values' + it { is_expected.to belong_to(:project) } it { is_expected.to belong_to(:user) } it { is_expected.to belong_to(:auto_canceled_by) } diff --git a/spec/models/ci/stage_spec.rb b/spec/models/ci/stage_spec.rb index 7559c533804..3228c400155 100644 --- a/spec/models/ci/stage_spec.rb +++ b/spec/models/ci/stage_spec.rb @@ -1,10 +1,10 @@ require 'spec_helper' describe Ci::Stage, :models do - it_behaves_like 'having unique enum values' - let(:stage) { create(:ci_stage_entity) } + it_behaves_like 'having unique enum values' + describe 'associations' do before do create(:ci_build, stage_id: stage.id) diff --git a/spec/models/clusters/applications/ingress_spec.rb b/spec/models/clusters/applications/ingress_spec.rb index 0d13901133b..cd28f1fe9c6 100644 --- a/spec/models/clusters/applications/ingress_spec.rb +++ b/spec/models/clusters/applications/ingress_spec.rb @@ -1,10 +1,10 @@ require 'rails_helper' describe Clusters::Applications::Ingress do - it_behaves_like 'having unique enum values' - let(:ingress) { create(:clusters_applications_ingress) } + it_behaves_like 'having unique enum values' + include_examples 'cluster application core specs', :clusters_applications_ingress include_examples 'cluster application status specs', :clusters_applications_ingress include_examples 'cluster application helm specs', :clusters_applications_ingress diff --git a/spec/models/clusters/platforms/kubernetes_spec.rb b/spec/models/clusters/platforms/kubernetes_spec.rb index eab69a39946..99e3797d5d5 100644 --- a/spec/models/clusters/platforms/kubernetes_spec.rb +++ b/spec/models/clusters/platforms/kubernetes_spec.rb @@ -4,8 +4,6 @@ describe Clusters::Platforms::Kubernetes, :use_clean_rails_memory_store_caching include KubernetesHelpers include ReactiveCachingHelpers - it_behaves_like 'having unique enum values' - it { is_expected.to belong_to(:cluster) } it { is_expected.to be_kind_of(Gitlab::Kubernetes) } it { is_expected.to be_kind_of(ReactiveCaching) } @@ -20,6 +18,8 @@ describe Clusters::Platforms::Kubernetes, :use_clean_rails_memory_store_caching it { is_expected.to delegate_method(:managed?).to(:cluster) } it { is_expected.to delegate_method(:kubernetes_namespace).to(:cluster) } + it_behaves_like 'having unique enum values' + describe 'before_validation' do context 'when namespace includes upper case' do let(:kubernetes) { create(:cluster_platform_kubernetes, :configured, namespace: namespace) } diff --git a/spec/models/commit_status_spec.rb b/spec/models/commit_status_spec.rb index be339abee72..8b7c88805c1 100644 --- a/spec/models/commit_status_spec.rb +++ b/spec/models/commit_status_spec.rb @@ -1,8 +1,6 @@ require 'spec_helper' describe CommitStatus do - it_behaves_like 'having unique enum values' - set(:project) { create(:project, :repository) } set(:pipeline) do @@ -15,6 +13,8 @@ describe CommitStatus do create(:commit_status, pipeline: pipeline, **opts) end + it_behaves_like 'having unique enum values' + it { is_expected.to belong_to(:pipeline) } it { is_expected.to belong_to(:user) } it { is_expected.to belong_to(:project) } diff --git a/spec/models/gpg_signature_spec.rb b/spec/models/gpg_signature_spec.rb index 69ca11971ff..cdd7dea2064 100644 --- a/spec/models/gpg_signature_spec.rb +++ b/spec/models/gpg_signature_spec.rb @@ -1,8 +1,6 @@ require 'rails_helper' RSpec.describe GpgSignature do - it_behaves_like 'having unique enum values' - let(:commit_sha) { '0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33' } let!(:project) { create(:project, :repository, path: 'sample-project') } let!(:commit) { create(:commit, project: project, sha: commit_sha) } @@ -10,6 +8,8 @@ RSpec.describe GpgSignature do let(:gpg_key) { create(:gpg_key) } let(:gpg_key_subkey) { create(:gpg_key_subkey) } + it_behaves_like 'having unique enum values' + describe 'associations' do it { is_expected.to belong_to(:project) } it { is_expected.to belong_to(:gpg_key) } diff --git a/spec/models/internal_id_spec.rb b/spec/models/internal_id_spec.rb index 1883069400f..4696341c05f 100644 --- a/spec/models/internal_id_spec.rb +++ b/spec/models/internal_id_spec.rb @@ -1,14 +1,14 @@ require 'spec_helper' describe InternalId do - it_behaves_like 'having unique enum values' - let(:project) { create(:project) } let(:usage) { :issues } let(:issue) { build(:issue, project: project) } let(:scope) { { project: project } } let(:init) { ->(s) { s.project.issues.size } } + it_behaves_like 'having unique enum values' + context 'validations' do it { is_expected.to validate_presence_of(:usage) } end diff --git a/spec/models/project_auto_devops_spec.rb b/spec/models/project_auto_devops_spec.rb index 3d83e0a11fb..7ff64c76e37 100644 --- a/spec/models/project_auto_devops_spec.rb +++ b/spec/models/project_auto_devops_spec.rb @@ -1,10 +1,10 @@ require 'spec_helper' describe ProjectAutoDevops do - it_behaves_like 'having unique enum values' - set(:project) { build(:project) } + it_behaves_like 'having unique enum values' + it { is_expected.to belong_to(:project) } it { is_expected.to define_enum_for(:deploy_strategy) } diff --git a/spec/models/prometheus_metric_spec.rb b/spec/models/prometheus_metric_spec.rb index 1737c498359..3692fe9a559 100644 --- a/spec/models/prometheus_metric_spec.rb +++ b/spec/models/prometheus_metric_spec.rb @@ -3,11 +3,11 @@ require 'spec_helper' describe PrometheusMetric do - it_behaves_like 'having unique enum values' - subject { build(:prometheus_metric) } let(:other_project) { build(:project) } + it_behaves_like 'having unique enum values' + it { is_expected.to belong_to(:project) } it { is_expected.to validate_presence_of(:title) } it { is_expected.to validate_presence_of(:query) } diff --git a/spec/models/resource_label_event_spec.rb b/spec/models/resource_label_event_spec.rb index 450a24d8445..e7e3f7376e6 100644 --- a/spec/models/resource_label_event_spec.rb +++ b/spec/models/resource_label_event_spec.rb @@ -3,12 +3,12 @@ require 'rails_helper' RSpec.describe ResourceLabelEvent, type: :model do - it_behaves_like 'having unique enum values' - subject { build(:resource_label_event, issue: issue) } let(:issue) { create(:issue) } let(:merge_request) { create(:merge_request) } + it_behaves_like 'having unique enum values' + describe 'associations' do it { is_expected.to belong_to(:user) } it { is_expected.to belong_to(:issue) } diff --git a/spec/models/user_callout_spec.rb b/spec/models/user_callout_spec.rb index 36443e37c95..d54355afe12 100644 --- a/spec/models/user_callout_spec.rb +++ b/spec/models/user_callout_spec.rb @@ -1,10 +1,10 @@ require 'rails_helper' describe UserCallout do - it_behaves_like 'having unique enum values' - let!(:callout) { create(:user_callout) } + it_behaves_like 'having unique enum values' + describe 'relationships' do it { is_expected.to belong_to(:user) } end |