debian-mirror-gitlab/spec/frontend/fixtures/api_projects.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

32 lines
934 B
Ruby
Raw Normal View History

2020-10-24 23:57:45 +05:30
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe API::Projects, '(JavaScript fixtures)', type: :request do
include ApiHelpers
include JavaScriptFixturesHelpers
let(:admin) { create(:admin, name: 'root') }
2022-10-11 01:57:18 +05:30
let(:namespace) { create(:namespace, name: 'gitlab-test' ) }
2020-10-24 23:57:45 +05:30
let(:project) { create(:project, :repository, namespace: namespace, path: 'lorem-ipsum') }
let(:project_empty) { create(:project_empty_repo, namespace: namespace, path: 'lorem-ipsum-empty') }
it 'api/projects/get.json' do
get api("/projects/#{project.id}", admin)
expect(response).to be_successful
end
it 'api/projects/get_empty.json' do
get api("/projects/#{project_empty.id}", admin)
expect(response).to be_successful
end
it 'api/projects/branches/get.json' do
get api("/projects/#{project.id}/repository/branches/#{project.default_branch}", admin)
expect(response).to be_successful
end
end