diff options
author | Shinya Maeda <shinya@gitlab.com> | 2017-08-22 22:59:08 +0900 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2017-09-03 23:49:10 +0900 |
commit | 1925bfd2a5b8fab48de8b1f2a4ae7db6a09736e1 (patch) | |
tree | 59b80df5134388f857a051babf59c4e35d47e209 | |
parent | bbe967abeba7be1db79e34439e74cd113c240b52 (diff) | |
download | gitlab-ce-1925bfd2a5b8fab48de8b1f2a4ae7db6a09736e1.tar.gz |
Fix spec
-rw-r--r-- | app/controllers/projects/runners_controller.rb | 2 | ||||
-rw-r--r-- | spec/lib/gitlab/import_export/safe_model_attributes.yml | 1 | ||||
-rw-r--r-- | spec/models/ci/runner_spec.rb | 8 | ||||
-rw-r--r-- | spec/services/ci/retry_build_service_spec.rb | 2 |
4 files changed, 7 insertions, 6 deletions
diff --git a/app/controllers/projects/runners_controller.rb b/app/controllers/projects/runners_controller.rb index bacecff3e7c..d07eddbd7fd 100644 --- a/app/controllers/projects/runners_controller.rb +++ b/app/controllers/projects/runners_controller.rb @@ -60,7 +60,7 @@ class Projects::RunnersController < Projects::ApplicationController def runner_params params.require(:runner).permit(Ci::Runner::FORM_EDITABLE).tap do |params| - params['access_level'] = params['access_level']&.to_i + params['access_level'] = params['access_level'].to_i if params['access_level'] end end end diff --git a/spec/lib/gitlab/import_export/safe_model_attributes.yml b/spec/lib/gitlab/import_export/safe_model_attributes.yml index a5e03e149a7..8c4810f292e 100644 --- a/spec/lib/gitlab/import_export/safe_model_attributes.yml +++ b/spec/lib/gitlab/import_export/safe_model_attributes.yml @@ -276,6 +276,7 @@ CommitStatus: - coverage_regex - auto_canceled_by_id - retried +- protected Ci::Variable: - id - project_id diff --git a/spec/models/ci/runner_spec.rb b/spec/models/ci/runner_spec.rb index 45a64b6f76f..a04d4615b6b 100644 --- a/spec/models/ci/runner_spec.rb +++ b/spec/models/ci/runner_spec.rb @@ -464,8 +464,8 @@ describe Ci::Runner do end it 'a protected runner exists' do - expect(Ci::Runner.count).to eq(1) - expect(Ci::Runner.last.protected_?).to eq(true) + expect(described_class.count).to eq(1) + expect(described_class.last.protected_?).to eq(true) end end @@ -475,8 +475,8 @@ describe Ci::Runner do end it 'an unprotected runner exists' do - expect(Ci::Runner.count).to eq(1) - expect(Ci::Runner.last.unprotected?).to eq(true) + expect(described_class.count).to eq(1) + expect(described_class.last.unprotected?).to eq(true) end end end diff --git a/spec/services/ci/retry_build_service_spec.rb b/spec/services/ci/retry_build_service_spec.rb index cec667071cc..d32ed9c33ee 100644 --- a/spec/services/ci/retry_build_service_spec.rb +++ b/spec/services/ci/retry_build_service_spec.rb @@ -22,7 +22,7 @@ describe Ci::RetryBuildService do %i[type lock_version target_url base_tags commit_id deployments erased_by_id last_deployment project_id runner_id tag_taggings taggings tags trigger_request_id - user_id auto_canceled_by_id retried].freeze + user_id auto_canceled_by_id retried protected].freeze shared_examples 'build duplication' do let(:stage) do |