diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-27 12:07:43 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-27 12:07:43 +0000 |
commit | 39fa7d1eeb2dba52f0601128f3ac91f57d19866e (patch) | |
tree | da042d34ff762dd1957e51666a34202295a081b9 /spec/factories | |
parent | 6ac4a6713ed3196af899011f7e18658e16ebaac0 (diff) | |
download | gitlab-ce-39fa7d1eeb2dba52f0601128f3ac91f57d19866e.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/factories')
-rw-r--r-- | spec/factories/services.rb | 20 | ||||
-rw-r--r-- | spec/factories/services_data.rb | 8 | ||||
-rw-r--r-- | spec/factories/terraform/state.rb | 11 |
3 files changed, 39 insertions, 0 deletions
diff --git a/spec/factories/services.rb b/spec/factories/services.rb index 2d6d8d71917..c011a9e3bb4 100644 --- a/spec/factories/services.rb +++ b/spec/factories/services.rb @@ -126,6 +126,26 @@ FactoryBot.define do end end + factory :open_project_service do + project + active { true } + + transient do + url { 'http://openproject.example.com' } + api_url { 'http://openproject.example.com/issues/:id' } + token { 'supersecret' } + closed_status_id { '15' } + project_identifier_code { 'PRJ-1' } + end + + after(:build) do |service, evaluator| + create(:open_project_tracker_data, service: service, + url: evaluator.url, api_url: evaluator.api_url, token: evaluator.token, + closed_status_id: evaluator.closed_status_id, project_identifier_code: evaluator.project_identifier_code + ) + end + end + trait :jira_cloud_service do url { 'https://mysite.atlassian.net' } username { 'jira_user' } diff --git a/spec/factories/services_data.rb b/spec/factories/services_data.rb index 5a3639895b6..c62fff2af55 100644 --- a/spec/factories/services_data.rb +++ b/spec/factories/services_data.rb @@ -9,4 +9,12 @@ FactoryBot.define do factory :issue_tracker_data do service end + + factory :open_project_tracker_data do + service + url { 'http://openproject.example.com'} + token { 'supersecret' } + project_identifier_code { 'PRJ-1' } + closed_status_id { '15' } + end end diff --git a/spec/factories/terraform/state.rb b/spec/factories/terraform/state.rb new file mode 100644 index 00000000000..4b83128ff6e --- /dev/null +++ b/spec/factories/terraform/state.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +FactoryBot.define do + factory :terraform_state, class: 'Terraform::State' do + project { create(:project) } + + trait :with_file do + file { fixture_file_upload('spec/fixtures/terraform/terraform.tfstate') } + end + end +end |