summaryrefslogtreecommitdiff
path: root/spec/factories/services.rb
blob: 70c34f8640be02b872c73139f94c1809e28651fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
FactoryBot.define do
  factory :service do
    project
    type 'Service'
  end

  factory :custom_issue_tracker_service, class: CustomIssueTrackerService do
    project
    type 'CustomIssueTrackerService'
    category 'issue_tracker'
    active true
    properties(
      project_url: 'https://project.url.com',
      issues_url: 'https://issues.url.com',
      new_issue_url: 'https://newissue.url.com'
    )
  end

  factory :kubernetes_service do
    project
    type 'KubernetesService'
    active true
    properties({
      api_url: 'https://kubernetes.example.com',
      token: 'a' * 40
    })
  end

  factory :mock_deployment_service do
    project
    type 'MockDeploymentService'
    active true
  end

  factory :prometheus_service do
    project
    active true
    properties({
      api_url: 'https://prometheus.example.com/',
      manual_configuration: true
    })
  end

  factory :jira_service do
    project
    active true
    properties(
      url: 'https://jira.example.com',
      username: 'jira_user',
      password: 'my-secret-password',
      project_key: 'jira-key'
    )
  end

  factory :jira_cloud_service, class: JiraService do
    project
    active true
    properties(
      url: 'https://mysite.atlassian.net',
      username: 'jira_user',
      password: 'my-secret-password',
      project_key: 'jira-key'
    )
  end
end