diff options
author | Shinya Maeda <shinya@gitlab.com> | 2017-08-26 04:04:57 +0900 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2017-09-04 21:55:26 +0900 |
commit | acc7497855167d4f6ba481422112645a1a04a885 (patch) | |
tree | d88d455aae397df882451be48bc776ec7a4ba28a /spec | |
parent | 75130a41ba19b80ac7b2300721915787ac4681bf (diff) | |
download | gitlab-ce-acc7497855167d4f6ba481422112645a1a04a885.tar.gz |
Revert autheticate! in Trigger API
Diffstat (limited to 'spec')
-rw-r--r-- | spec/factories/ci/builds.rb | 2 | ||||
-rw-r--r-- | spec/factories/ci/trigger_requests.rb | 17 | ||||
-rw-r--r-- | spec/features/projects/jobs_spec.rb | 2 | ||||
-rw-r--r-- | spec/models/ci/build_spec.rb | 2 | ||||
-rw-r--r-- | spec/requests/api/runner_spec.rb | 2 | ||||
-rw-r--r-- | spec/requests/api/v3/triggers_spec.rb | 2 | ||||
-rw-r--r-- | spec/views/projects/jobs/show.html.haml_spec.rb | 2 |
7 files changed, 14 insertions, 15 deletions
diff --git a/spec/factories/ci/builds.rb b/spec/factories/ci/builds.rb index 25ec63de94a..592df038aa3 100644 --- a/spec/factories/ci/builds.rb +++ b/spec/factories/ci/builds.rb @@ -107,7 +107,7 @@ FactoryGirl.define do end trait :triggered do - trigger_request factory: :ci_trigger_request_with_variables + trigger_request factory: :ci_trigger_request_with_variables # TODO: end after(:build) do |build, evaluator| diff --git a/spec/factories/ci/trigger_requests.rb b/spec/factories/ci/trigger_requests.rb index b6239385438..10e0ab4fd3c 100644 --- a/spec/factories/ci/trigger_requests.rb +++ b/spec/factories/ci/trigger_requests.rb @@ -2,14 +2,13 @@ FactoryGirl.define do factory :ci_trigger_request, class: Ci::TriggerRequest do trigger factory: :ci_trigger - # TODO: - # factory :ci_trigger_request_with_variables do - # variables do - # { - # TRIGGER_KEY_1: 'TRIGGER_VALUE_1', - # TRIGGER_KEY_2: 'TRIGGER_VALUE_2' - # } - # end - # end + factory :ci_trigger_request_with_variables do + variables do + { + TRIGGER_KEY_1: 'TRIGGER_VALUE_1', + TRIGGER_KEY_2: 'TRIGGER_VALUE_2' + } + end + end end end diff --git a/spec/features/projects/jobs_spec.rb b/spec/features/projects/jobs_spec.rb index 037ac00d39f..3f59a66403b 100644 --- a/spec/features/projects/jobs_spec.rb +++ b/spec/features/projects/jobs_spec.rb @@ -292,7 +292,7 @@ feature 'Jobs' do end feature 'Variables' do - let(:trigger_request) { create(:ci_trigger_request_with_variables) } + let(:trigger_request) { create(:ci_trigger_request_with_variables) } # TODO: let(:job) do create :ci_build, pipeline: pipeline, trigger_request: trigger_request diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb index 3fe3ec17d36..c0ac4816ae1 100644 --- a/spec/models/ci/build_spec.rb +++ b/spec/models/ci/build_spec.rb @@ -1492,7 +1492,7 @@ describe Ci::Build do context 'when build is for triggers' do let(:trigger) { create(:ci_trigger, project: project) } - let(:trigger_request) { create(:ci_trigger_request_with_variables, pipeline: pipeline, trigger: trigger) } + let(:trigger_request) { create(:ci_trigger_request_with_variables, pipeline: pipeline, trigger: trigger) } # TODO: let(:user_trigger_variable) do { key: :TRIGGER_KEY_1, value: 'TRIGGER_VALUE_1', public: false } end diff --git a/spec/requests/api/runner_spec.rb b/spec/requests/api/runner_spec.rb index 993164aa8fe..d3b29426db1 100644 --- a/spec/requests/api/runner_spec.rb +++ b/spec/requests/api/runner_spec.rb @@ -559,7 +559,7 @@ describe API::Runner do before do trigger = create(:ci_trigger, project: project) - create(:ci_trigger_request_with_variables, pipeline: pipeline, builds: [job], trigger: trigger) + create(:ci_trigger_request_with_variables, pipeline: pipeline, builds: [job], trigger: trigger) # TODO: project.variables << Ci::Variable.new(key: 'SECRET_KEY', value: 'secret_value') end diff --git a/spec/requests/api/v3/triggers_spec.rb b/spec/requests/api/v3/triggers_spec.rb index d4648136841..aca912dd427 100644 --- a/spec/requests/api/v3/triggers_spec.rb +++ b/spec/requests/api/v3/triggers_spec.rb @@ -37,7 +37,7 @@ describe API::V3::Triggers do it 'returns unauthorized if token is for different project' do post v3_api("/projects/#{project2.id}/trigger/builds"), options.merge(ref: 'master') - expect(response).to have_http_status(401) + expect(response).to have_http_status(404) end end diff --git a/spec/views/projects/jobs/show.html.haml_spec.rb b/spec/views/projects/jobs/show.html.haml_spec.rb index 117f48450e2..7405df1742e 100644 --- a/spec/views/projects/jobs/show.html.haml_spec.rb +++ b/spec/views/projects/jobs/show.html.haml_spec.rb @@ -197,7 +197,7 @@ describe 'projects/jobs/show' do end describe 'shows trigger variables in sidebar' do - let(:trigger_request) { create(:ci_trigger_request_with_variables, pipeline: pipeline) } + let(:trigger_request) { create(:ci_trigger_request_with_variables, pipeline: pipeline) } # TODO: before do build.trigger_request = trigger_request |