Fix: models/ci/project_spec.rb
This commit is contained in:
parent
209c72c4a1
commit
8d5c9935ff
|
|
@ -124,19 +124,15 @@ describe Ci::Project do
|
|||
end
|
||||
|
||||
describe 'Project.parse' do
|
||||
let(:project_dump) { YAML.load File.read(Rails.root.join('spec/support/gitlab_stubs/raw_project.yml')) }
|
||||
let(:parsed_project) { Ci::Project.parse(project_dump) }
|
||||
let(:project) { FactoryGirl.create :project }
|
||||
|
||||
subject { Ci::Project.parse(project) }
|
||||
|
||||
it { expect(parsed_project).to be_valid }
|
||||
it { expect(parsed_project).to be_kind_of(Ci::Project) }
|
||||
it { expect(parsed_project.name).to eq("GitLab / api.gitlab.org") }
|
||||
it { expect(parsed_project.gitlab_id).to eq(189) }
|
||||
it { expect(parsed_project.gitlab_url).to eq("http://demo.gitlab.com/gitlab/api-gitlab-org") }
|
||||
|
||||
it "parses plain hash" do
|
||||
expect(Ci::Project.parse(project_dump).name).to eq("GitLab / api.gitlab.org")
|
||||
end
|
||||
it { is_expected.to be_valid }
|
||||
it { is_expected.to be_kind_of(Ci::Project) }
|
||||
it { expect(subject.name).to eq(project.name_with_namespace) }
|
||||
it { expect(subject.gitlab_id).to eq(4) }
|
||||
it { expect(subject.gitlab_url).to eq("http://localhost/namespace5/gitlabhq") }
|
||||
end
|
||||
|
||||
describe :repo_url_with_auth do
|
||||
|
|
|
|||
|
|
@ -1,36 +0,0 @@
|
|||
--- !ruby/object:OpenStruct
|
||||
table:
|
||||
:id: 189
|
||||
:description: Website at http://api.gitlab.org/
|
||||
:default_branch: master
|
||||
:public: false
|
||||
:visibility_level: 0
|
||||
:ssh_url_to_repo: dzaporozhets@localhost:gitlab/api-gitlab-org.git
|
||||
:http_url_to_repo: http://localhost:3000/gitlab/api-gitlab-org.git
|
||||
:web_url: http://localhost:3000/gitlab/api-gitlab-org
|
||||
:owner:
|
||||
id: 1
|
||||
name: GitLab
|
||||
created_at: '2012-10-03T09:59:57.000Z'
|
||||
:name: api.gitlab.org
|
||||
:name_with_namespace: GitLab / api.gitlab.org
|
||||
:path: api-gitlab-org
|
||||
:path_with_namespace: gitlab/api-gitlab-org
|
||||
:issues_enabled: true
|
||||
:merge_requests_enabled: true
|
||||
:wall_enabled: false
|
||||
:wiki_enabled: false
|
||||
:snippets_enabled: false
|
||||
:created_at: '2013-06-06T12:29:39.000Z'
|
||||
:last_activity_at: '2013-12-06T20:29:42.000Z'
|
||||
:namespace:
|
||||
id: 1
|
||||
name: GitLab
|
||||
path: gitlab
|
||||
owner_id: 1
|
||||
created_at: '2012-10-03T09:59:57.000Z'
|
||||
updated_at: '2014-01-28T08:49:53.000Z'
|
||||
description: Self hosted Git management software
|
||||
avatar:
|
||||
url: /uploads/group/avatar/1/0-vader-profile.jpg
|
||||
|
||||
Loading…
Reference in New Issue