2016-04-15 07:08:22 -04:00
|
|
|
RSpec.shared_examples 'project hook data with deprecateds' do |project_key: :project|
|
Add new data to project in push, issue, merge-request and note webhooks data
- Add `avatar_url`, `description`, `git_ssh_url`, `git_http_url`,
`path_with_namespace` and `default_branch` in `project` in push, issue,
merge-request and note webhooks data
- Deprecate the `ssh_url` in favor of `git_ssh_url` and `http_url` in
favor of `git_http_url` in `project` for push, issue, merge-request and
note webhooks data
- Deprecate the `repository` key in push, issue, merge-request and
note webhooks data, use `project` instead
2016-02-06 09:20:21 -05:00
|
|
|
it 'contains project data' do
|
|
|
|
expect(data[project_key][:name]).to eq(project.name)
|
|
|
|
expect(data[project_key][:description]).to eq(project.description)
|
|
|
|
expect(data[project_key][:web_url]).to eq(project.web_url)
|
|
|
|
expect(data[project_key][:avatar_url]).to eq(project.avatar_url)
|
|
|
|
expect(data[project_key][:git_http_url]).to eq(project.http_url_to_repo)
|
|
|
|
expect(data[project_key][:git_ssh_url]).to eq(project.ssh_url_to_repo)
|
|
|
|
expect(data[project_key][:namespace]).to eq(project.namespace.name)
|
|
|
|
expect(data[project_key][:visibility_level]).to eq(project.visibility_level)
|
2017-07-20 05:34:09 -04:00
|
|
|
expect(data[project_key][:path_with_namespace]).to eq(project.full_path)
|
Add new data to project in push, issue, merge-request and note webhooks data
- Add `avatar_url`, `description`, `git_ssh_url`, `git_http_url`,
`path_with_namespace` and `default_branch` in `project` in push, issue,
merge-request and note webhooks data
- Deprecate the `ssh_url` in favor of `git_ssh_url` and `http_url` in
favor of `git_http_url` in `project` for push, issue, merge-request and
note webhooks data
- Deprecate the `repository` key in push, issue, merge-request and
note webhooks data, use `project` instead
2016-02-06 09:20:21 -05:00
|
|
|
expect(data[project_key][:default_branch]).to eq(project.default_branch)
|
|
|
|
expect(data[project_key][:homepage]).to eq(project.web_url)
|
|
|
|
expect(data[project_key][:url]).to eq(project.url_to_repo)
|
|
|
|
expect(data[project_key][:ssh_url]).to eq(project.ssh_url_to_repo)
|
|
|
|
expect(data[project_key][:http_url]).to eq(project.http_url_to_repo)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2016-04-15 07:08:22 -04:00
|
|
|
RSpec.shared_examples 'project hook data' do |project_key: :project|
|
|
|
|
it 'contains project data' do
|
|
|
|
expect(data[project_key][:name]).to eq(project.name)
|
|
|
|
expect(data[project_key][:description]).to eq(project.description)
|
|
|
|
expect(data[project_key][:web_url]).to eq(project.web_url)
|
|
|
|
expect(data[project_key][:avatar_url]).to eq(project.avatar_url)
|
|
|
|
expect(data[project_key][:git_http_url]).to eq(project.http_url_to_repo)
|
|
|
|
expect(data[project_key][:git_ssh_url]).to eq(project.ssh_url_to_repo)
|
|
|
|
expect(data[project_key][:namespace]).to eq(project.namespace.name)
|
|
|
|
expect(data[project_key][:visibility_level]).to eq(project.visibility_level)
|
2017-07-20 05:34:09 -04:00
|
|
|
expect(data[project_key][:path_with_namespace]).to eq(project.full_path)
|
2016-04-15 07:08:22 -04:00
|
|
|
expect(data[project_key][:default_branch]).to eq(project.default_branch)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
Add new data to project in push, issue, merge-request and note webhooks data
- Add `avatar_url`, `description`, `git_ssh_url`, `git_http_url`,
`path_with_namespace` and `default_branch` in `project` in push, issue,
merge-request and note webhooks data
- Deprecate the `ssh_url` in favor of `git_ssh_url` and `http_url` in
favor of `git_http_url` in `project` for push, issue, merge-request and
note webhooks data
- Deprecate the `repository` key in push, issue, merge-request and
note webhooks data, use `project` instead
2016-02-06 09:20:21 -05:00
|
|
|
RSpec.shared_examples 'deprecated repository hook data' do |project_key: :project|
|
|
|
|
it 'contains deprecated repository data' do
|
|
|
|
expect(data[:repository][:name]).to eq(project.name)
|
|
|
|
expect(data[:repository][:description]).to eq(project.description)
|
|
|
|
expect(data[:repository][:url]).to eq(project.url_to_repo)
|
|
|
|
expect(data[:repository][:homepage]).to eq(project.web_url)
|
|
|
|
end
|
|
|
|
end
|