gitlab-org--gitlab-foss/spec/factories/services.rb
Rémy Coutable 4af9d592c5 Replace factory_girl_rails with factory_bot_rails
I've followed the [upgrade guide](https://github.com/thoughtbot/factory_bot/blob/4-9-0-stable/UPGRADE_FROM_FACTORY_GIRL.md) and ran these two commands:

```
grep -e FactoryGirl **/*.rake **/*.rb -s -l | xargs sed -i "" "s|FactoryGirl|FactoryBot|"
grep -e factory_girl **/*.rake **/*.rb -s -l | xargs sed -i "" "s|factory_girl|factory_bot|"
```

Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-12-14 15:01:55 +01:00

52 lines
1 KiB
Ruby

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
active true
properties({
api_url: 'https://kubernetes.example.com',
token: 'a' * 40
})
end
factory :prometheus_service do
project
active true
properties({
api_url: 'https://prometheus.example.com/'
})
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 :hipchat_service do
project
type 'HipchatService'
token 'test_token'
end
end