BigW Consortium Gitlab

project_hook_data_shared_example.rb 2.31 KB
Newer Older
1
RSpec.shared_examples 'project hook data with deprecateds' do |project_key: :project|
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
  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)
    expect(data[project_key][:path_with_namespace]).to eq(project.path_with_namespace)
    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

20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
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)
    expect(data[project_key][:path_with_namespace]).to eq(project.path_with_namespace)
    expect(data[project_key][:default_branch]).to eq(project.default_branch)
  end
end

35 36 37 38 39 40 41 42
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