Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
8d5c9935
Commit
8d5c9935
authored
Sep 15, 2015
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix: models/ci/project_spec.rb
parent
209c72c4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
47 deletions
+7
-47
spec/models/ci/project_spec.rb
spec/models/ci/project_spec.rb
+7
-11
spec/support/gitlab_stubs/raw_project.yml
spec/support/gitlab_stubs/raw_project.yml
+0
-36
No files found.
spec/models/ci/project_spec.rb
View file @
8d5c9935
...
@@ -124,19 +124,15 @@ describe Ci::Project do
...
@@ -124,19 +124,15 @@ describe Ci::Project do
end
end
describe
'Project.parse'
do
describe
'Project.parse'
do
let
(
:project_dump
)
{
YAML
.
load
File
.
read
(
Rails
.
root
.
join
(
'spec/support/gitlab_stubs/raw_project.yml'
))
}
let
(
:project
)
{
FactoryGirl
.
create
:project
}
let
(
:parsed_project
)
{
Ci
::
Project
.
parse
(
project_dump
)
}
subject
{
Ci
::
Project
.
parse
(
project
)
}
it
{
expect
(
parsed_project
).
to
be_valid
}
it
{
is_expected
.
to
be_valid
}
it
{
expect
(
parsed_project
).
to
be_kind_of
(
Ci
::
Project
)
}
it
{
is_expected
.
to
be_kind_of
(
Ci
::
Project
)
}
it
{
expect
(
parsed_project
.
name
).
to
eq
(
"GitLab / api.gitlab.org"
)
}
it
{
expect
(
subject
.
name
).
to
eq
(
project
.
name_with_namespace
)
}
it
{
expect
(
parsed_project
.
gitlab_id
).
to
eq
(
189
)
}
it
{
expect
(
subject
.
gitlab_id
).
to
eq
(
4
)
}
it
{
expect
(
parsed_project
.
gitlab_url
).
to
eq
(
"http://demo.gitlab.com/gitlab/api-gitlab-org"
)
}
it
{
expect
(
subject
.
gitlab_url
).
to
eq
(
"http://localhost/namespace5/gitlabhq"
)
}
it
"parses plain hash"
do
expect
(
Ci
::
Project
.
parse
(
project_dump
).
name
).
to
eq
(
"GitLab / api.gitlab.org"
)
end
end
end
describe
:repo_url_with_auth
do
describe
:repo_url_with_auth
do
...
...
spec/support/gitlab_stubs/raw_project.yml
deleted
100644 → 0
View file @
209c72c4
---
!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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment