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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
df9cbbc9
Commit
df9cbbc9
authored
Sep 05, 2013
by
Hiroyuki Sato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Drop support of root namespace in routing
parent
e1ca9de0
Changes
17
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
129 additions
and
149 deletions
+129
-149
config/routes.rb
config/routes.rb
+12
-12
features/steps/dashboard/dashboard.rb
features/steps/dashboard/dashboard.rb
+1
-1
features/steps/group/group.rb
features/steps/group/group.rb
+1
-1
features/steps/project/project_network_graph.rb
features/steps/project/project_network_graph.rb
+0
-5
lib/api/merge_requests.rb
lib/api/merge_requests.rb
+1
-1
spec/controllers/blob_controller_spec.rb
spec/controllers/blob_controller_spec.rb
+1
-1
spec/controllers/commit_controller_spec.rb
spec/controllers/commit_controller_spec.rb
+7
-7
spec/controllers/commits_controller_spec.rb
spec/controllers/commits_controller_spec.rb
+1
-1
spec/controllers/merge_requests_controller_spec.rb
spec/controllers/merge_requests_controller_spec.rb
+7
-7
spec/controllers/tree_controller_spec.rb
spec/controllers/tree_controller_spec.rb
+1
-1
spec/factories.rb
spec/factories.rb
+1
-0
spec/features/atom/issues_spec.rb
spec/features/atom/issues_spec.rb
+1
-1
spec/models/project_spec.rb
spec/models/project_spec.rb
+2
-19
spec/requests/api/merge_requests_spec.rb
spec/requests/api/merge_requests_spec.rb
+29
-28
spec/routing/project_routing_spec.rb
spec/routing/project_routing_spec.rb
+61
-61
spec/routing/routing_spec.rb
spec/routing/routing_spec.rb
+2
-2
spec/services/git_push_service_spec.rb
spec/services/git_push_service_spec.rb
+1
-1
No files found.
config/routes.rb
View file @
df9cbbc9
...
@@ -157,7 +157,7 @@ Gitlab::Application.routes.draw do
...
@@ -157,7 +157,7 @@ Gitlab::Application.routes.draw do
#
#
# Project Area
# Project Area
#
#
resources
:projects
,
constraints:
{
id:
/
(?:[a-zA-Z.0-9_\-]+\/)?
[a-zA-Z.0-9_\-]+/
},
except:
[
:new
,
:create
,
:index
],
path:
"/"
do
resources
:projects
,
constraints:
{
id:
/
[a-zA-Z.0-9_\-]+\/
[a-zA-Z.0-9_\-]+/
},
except:
[
:new
,
:create
,
:index
],
path:
"/"
do
member
do
member
do
put
:transfer
put
:transfer
post
:fork
post
:fork
...
@@ -177,13 +177,13 @@ Gitlab::Application.routes.draw do
...
@@ -177,13 +177,13 @@ Gitlab::Application.routes.draw do
resources
:graphs
,
only:
[
:show
],
constraints:
{
id:
/(?:[^.]|\.(?!json$))+/
,
format:
/json/
}
resources
:graphs
,
only:
[
:show
],
constraints:
{
id:
/(?:[^.]|\.(?!json$))+/
,
format:
/json/
}
match
"/compare/:from...:to"
=>
"compare#show"
,
as:
"compare"
,
via:
[
:get
,
:post
],
constraints:
{
from:
/.+/
,
to:
/.+/
}
match
"/compare/:from...:to"
=>
"compare#show"
,
as:
"compare"
,
via:
[
:get
,
:post
],
constraints:
{
from:
/.+/
,
to:
/.+/
}
resources
:snippets
do
resources
:snippets
,
constraints:
{
id:
/\d+/
}
do
member
do
member
do
get
"raw"
get
"raw"
end
end
end
end
resources
:wikis
,
only:
[
:show
,
:edit
,
:destroy
,
:create
]
do
resources
:wikis
,
only:
[
:show
,
:edit
,
:destroy
,
:create
]
,
constraints:
{
id:
/[a-zA-Z.0-9_\-]+/
}
do
collection
do
collection
do
get
:pages
get
:pages
put
':id'
=>
'wikis#update'
put
':id'
=>
'wikis#update'
...
@@ -195,7 +195,7 @@ Gitlab::Application.routes.draw do
...
@@ -195,7 +195,7 @@ Gitlab::Application.routes.draw do
end
end
end
end
resource
:wall
,
only:
[
:show
]
do
resource
:wall
,
only:
[
:show
]
,
constraints:
{
id:
/\d+/
}
do
member
do
member
do
get
'notes'
get
'notes'
end
end
...
@@ -214,21 +214,21 @@ Gitlab::Application.routes.draw do
...
@@ -214,21 +214,21 @@ Gitlab::Application.routes.draw do
end
end
end
end
resources
:deploy_keys
do
resources
:deploy_keys
,
constraints:
{
id:
/\d+/
}
do
member
do
member
do
put
:enable
put
:enable
put
:disable
put
:disable
end
end
end
end
resources
:branches
,
only:
[
:index
,
:new
,
:create
,
:destroy
]
do
resources
:branches
,
only:
[
:index
,
:new
,
:create
,
:destroy
]
,
constraints:
{
id:
/[a-zA-Z.\/0-9_\-#%+]+/
}
do
collection
do
collection
do
get
:recent
get
:recent
end
end
end
end
resources
:tags
,
only:
[
:index
,
:new
,
:create
,
:destroy
]
resources
:tags
,
only:
[
:index
,
:new
,
:create
,
:destroy
]
,
constraints:
{
id:
/[a-zA-Z.\/0-9_\-#%+]+/
}
resources
:protected_branches
,
only:
[
:index
,
:create
,
:destroy
]
resources
:protected_branches
,
only:
[
:index
,
:create
,
:destroy
]
,
constraints:
{
id:
/[a-zA-Z.\/0-9_\-#%+]+/
}
resources
:refs
,
only:
[]
do
resources
:refs
,
only:
[]
do
collection
do
collection
do
...
@@ -262,14 +262,14 @@ Gitlab::Application.routes.draw do
...
@@ -262,14 +262,14 @@ Gitlab::Application.routes.draw do
end
end
end
end
resources
:hooks
,
only:
[
:index
,
:create
,
:destroy
]
do
resources
:hooks
,
only:
[
:index
,
:create
,
:destroy
]
,
constraints:
{
id:
/\d+/
}
do
member
do
member
do
get
:test
get
:test
end
end
end
end
resources
:team
,
controller:
'team_members'
,
only:
[
:index
]
resources
:team
,
controller:
'team_members'
,
only:
[
:index
]
resources
:milestones
,
except:
[
:destroy
]
resources
:milestones
,
except:
[
:destroy
]
,
constraints:
{
id:
/\d+/
}
resources
:labels
,
only:
[
:index
]
do
resources
:labels
,
only:
[
:index
]
do
collection
do
collection
do
...
@@ -283,7 +283,7 @@ Gitlab::Application.routes.draw do
...
@@ -283,7 +283,7 @@ Gitlab::Application.routes.draw do
end
end
end
end
resources
:team_members
,
except:
[
:index
,
:edit
]
do
resources
:team_members
,
except:
[
:index
,
:edit
]
,
constraints:
{
id:
/[a-zA-Z.\/0-9_\-#%+]+/
}
do
collection
do
collection
do
# Used for import team
# Used for import team
...
@@ -293,7 +293,7 @@ Gitlab::Application.routes.draw do
...
@@ -293,7 +293,7 @@ Gitlab::Application.routes.draw do
end
end
end
end
resources
:notes
,
only:
[
:index
,
:create
,
:destroy
,
:update
]
do
resources
:notes
,
only:
[
:index
,
:create
,
:destroy
,
:update
]
,
constraints:
{
id:
/\d+/
}
do
member
do
member
do
delete
:delete_attachment
delete
:delete_attachment
end
end
...
...
features/steps/dashboard/dashboard.rb
View file @
df9cbbc9
...
@@ -57,7 +57,7 @@ class Dashboard < Spinach::FeatureSteps
...
@@ -57,7 +57,7 @@ class Dashboard < Spinach::FeatureSteps
And
'I have group with projects'
do
And
'I have group with projects'
do
@group
=
create
(
:group
)
@group
=
create
(
:group
)
@project
=
create
(
:project
,
group
:
@group
)
@project
=
create
(
:project
,
namespace
:
@group
)
@event
=
create
(
:closed_issue_event
,
project:
@project
)
@event
=
create
(
:closed_issue_event
,
project:
@project
)
@project
.
team
<<
[
current_user
,
:master
]
@project
.
team
<<
[
current_user
,
:master
]
...
...
features/steps/group/group.rb
View file @
df9cbbc9
...
@@ -11,7 +11,7 @@ class Groups < Spinach::FeatureSteps
...
@@ -11,7 +11,7 @@ class Groups < Spinach::FeatureSteps
And
'I have group with projects'
do
And
'I have group with projects'
do
@group
=
create
(
:group
,
owner:
current_user
)
@group
=
create
(
:group
,
owner:
current_user
)
@project
=
create
(
:project
,
group
:
@group
)
@project
=
create
(
:project
,
namespace
:
@group
)
@event
=
create
(
:closed_issue_event
,
project:
@project
)
@event
=
create
(
:closed_issue_event
,
project:
@project
)
@project
.
team
<<
[
current_user
,
:master
]
@project
.
team
<<
[
current_user
,
:master
]
...
...
features/steps/project/project_network_graph.rb
View file @
df9cbbc9
...
@@ -38,11 +38,6 @@ class ProjectNetworkGraph < Spinach::FeatureSteps
...
@@ -38,11 +38,6 @@ class ProjectNetworkGraph < Spinach::FeatureSteps
sleep
2
sleep
2
end
end
When
'I switch ref to "v2.1.0"'
do
page
.
select
'v2.1.0'
,
from:
'ref'
sleep
2
end
When
'click "Show only selected branch" checkbox'
do
When
'click "Show only selected branch" checkbox'
do
find
(
'#filter_ref'
).
click
find
(
'#filter_ref'
).
click
sleep
2
sleep
2
...
...
lib/api/merge_requests.rb
View file @
df9cbbc9
...
@@ -4,7 +4,7 @@ module API
...
@@ -4,7 +4,7 @@ module API
before
{
authenticate!
}
before
{
authenticate!
}
before
{
Thread
.
current
[
:current_user
]
=
current_user
}
before
{
Thread
.
current
[
:current_user
]
=
current_user
}
resource
:projects
do
resource
:projects
,
requirements:
{
id:
/[a-zA-Z.0-9_\-]+\/[a-zA-Z.0-9_\-]+/
}
do
helpers
do
helpers
do
def
handle_merge_request_errors!
(
errors
)
def
handle_merge_request_errors!
(
errors
)
if
errors
[
:project_access
].
any?
if
errors
[
:project_access
].
any?
...
...
spec/controllers/blob_controller_spec.rb
View file @
df9cbbc9
...
@@ -17,7 +17,7 @@ describe Projects::BlobController do
...
@@ -17,7 +17,7 @@ describe Projects::BlobController do
describe
"GET show"
do
describe
"GET show"
do
render_views
render_views
before
{
get
:show
,
project_id:
project
.
code
,
id:
id
}
before
{
get
:show
,
project_id:
project
.
to_param
,
id:
id
}
context
"valid branch, valid file"
do
context
"valid branch, valid file"
do
let
(
:id
)
{
'master/README.md'
}
let
(
:id
)
{
'master/README.md'
}
...
...
spec/controllers/commit_controller_spec.rb
View file @
df9cbbc9
...
@@ -13,7 +13,7 @@ describe Projects::CommitController do
...
@@ -13,7 +13,7 @@ describe Projects::CommitController do
describe
"#show"
do
describe
"#show"
do
shared_examples
"export as"
do
|
format
|
shared_examples
"export as"
do
|
format
|
it
"should generally work"
do
it
"should generally work"
do
get
:show
,
project_id:
project
.
code
,
id:
commit
.
id
,
format:
format
get
:show
,
project_id:
project
.
to_param
,
id:
commit
.
id
,
format:
format
expect
(
response
).
to
be_success
expect
(
response
).
to
be_success
end
end
...
@@ -21,11 +21,11 @@ describe Projects::CommitController do
...
@@ -21,11 +21,11 @@ describe Projects::CommitController do
it
"should generate it"
do
it
"should generate it"
do
Commit
.
any_instance
.
should_receive
(
:"to_
#{
format
}
"
)
Commit
.
any_instance
.
should_receive
(
:"to_
#{
format
}
"
)
get
:show
,
project_id:
project
.
code
,
id:
commit
.
id
,
format:
format
get
:show
,
project_id:
project
.
to_param
,
id:
commit
.
id
,
format:
format
end
end
it
"should render it"
do
it
"should render it"
do
get
:show
,
project_id:
project
.
code
,
id:
commit
.
id
,
format:
format
get
:show
,
project_id:
project
.
to_param
,
id:
commit
.
id
,
format:
format
expect
(
response
.
body
).
to
eq
(
commit
.
send
(
:"to_
#{
format
}
"
))
expect
(
response
.
body
).
to
eq
(
commit
.
send
(
:"to_
#{
format
}
"
))
end
end
...
@@ -33,7 +33,7 @@ describe Projects::CommitController do
...
@@ -33,7 +33,7 @@ describe Projects::CommitController do
it
"should not escape Html"
do
it
"should not escape Html"
do
Commit
.
any_instance
.
stub
(
:"to_
#{
format
}
"
).
and_return
(
'HTML entities &<>" '
)
Commit
.
any_instance
.
stub
(
:"to_
#{
format
}
"
).
and_return
(
'HTML entities &<>" '
)
get
:show
,
project_id:
project
.
code
,
id:
commit
.
id
,
format:
format
get
:show
,
project_id:
project
.
to_param
,
id:
commit
.
id
,
format:
format
expect
(
response
.
body
).
to_not
include
(
'&'
)
expect
(
response
.
body
).
to_not
include
(
'&'
)
expect
(
response
.
body
).
to_not
include
(
'>'
)
expect
(
response
.
body
).
to_not
include
(
'>'
)
...
@@ -47,7 +47,7 @@ describe Projects::CommitController do
...
@@ -47,7 +47,7 @@ describe Projects::CommitController do
let
(
:format
)
{
:diff
}
let
(
:format
)
{
:diff
}
it
"should really only be a git diff"
do
it
"should really only be a git diff"
do
get
:show
,
project_id:
project
.
code
,
id:
commit
.
id
,
format:
format
get
:show
,
project_id:
project
.
to_param
,
id:
commit
.
id
,
format:
format
expect
(
response
.
body
).
to
start_with
(
"diff --git"
)
expect
(
response
.
body
).
to
start_with
(
"diff --git"
)
end
end
...
@@ -58,13 +58,13 @@ describe Projects::CommitController do
...
@@ -58,13 +58,13 @@ describe Projects::CommitController do
let
(
:format
)
{
:patch
}
let
(
:format
)
{
:patch
}
it
"should really be a git email patch"
do
it
"should really be a git email patch"
do
get
:show
,
project_id:
project
.
code
,
id:
commit
.
id
,
format:
format
get
:show
,
project_id:
project
.
to_param
,
id:
commit
.
id
,
format:
format
expect
(
response
.
body
).
to
start_with
(
"From
#{
commit
.
id
}
"
)
expect
(
response
.
body
).
to
start_with
(
"From
#{
commit
.
id
}
"
)
end
end
it
"should contain a git diff"
do
it
"should contain a git diff"
do
get
:show
,
project_id:
project
.
code
,
id:
commit
.
id
,
format:
format
get
:show
,
project_id:
project
.
to_param
,
id:
commit
.
id
,
format:
format
expect
(
response
.
body
).
to
match
(
/^diff --git/
)
expect
(
response
.
body
).
to
match
(
/^diff --git/
)
end
end
...
...
spec/controllers/commits_controller_spec.rb
View file @
df9cbbc9
...
@@ -13,7 +13,7 @@ describe Projects::CommitsController do
...
@@ -13,7 +13,7 @@ describe Projects::CommitsController do
describe
"GET show"
do
describe
"GET show"
do
context
"as atom feed"
do
context
"as atom feed"
do
it
"should render as atom"
do
it
"should render as atom"
do
get
:show
,
project_id:
project
.
path
,
id:
"master"
,
format:
"atom"
get
:show
,
project_id:
project
.
to_param
,
id:
"master"
,
format:
"atom"
response
.
should
be_success
response
.
should
be_success
response
.
content_type
.
should
==
'application/atom+xml'
response
.
content_type
.
should
==
'application/atom+xml'
end
end
...
...
spec/controllers/merge_requests_controller_spec.rb
View file @
df9cbbc9
...
@@ -14,7 +14,7 @@ describe Projects::MergeRequestsController do
...
@@ -14,7 +14,7 @@ describe Projects::MergeRequestsController do
describe
"#show"
do
describe
"#show"
do
shared_examples
"export merge as"
do
|
format
|
shared_examples
"export merge as"
do
|
format
|
it
"should generally work"
do
it
"should generally work"
do
get
:show
,
project_id:
project
.
code
,
id:
merge_request
.
iid
,
format:
format
get
:show
,
project_id:
project
.
to_param
,
id:
merge_request
.
iid
,
format:
format
expect
(
response
).
to
be_success
expect
(
response
).
to
be_success
end
end
...
@@ -22,11 +22,11 @@ describe Projects::MergeRequestsController do
...
@@ -22,11 +22,11 @@ describe Projects::MergeRequestsController do
it
"should generate it"
do
it
"should generate it"
do
MergeRequest
.
any_instance
.
should_receive
(
:"to_
#{
format
}
"
)
MergeRequest
.
any_instance
.
should_receive
(
:"to_
#{
format
}
"
)
get
:show
,
project_id:
project
.
code
,
id:
merge_request
.
iid
,
format:
format
get
:show
,
project_id:
project
.
to_param
,
id:
merge_request
.
iid
,
format:
format
end
end
it
"should render it"
do
it
"should render it"
do
get
:show
,
project_id:
project
.
code
,
id:
merge_request
.
iid
,
format:
format
get
:show
,
project_id:
project
.
to_param
,
id:
merge_request
.
iid
,
format:
format
expect
(
response
.
body
).
to
eq
((
merge_request
.
send
(
:"to_
#{
format
}
"
,
user
)).
to_s
)
expect
(
response
.
body
).
to
eq
((
merge_request
.
send
(
:"to_
#{
format
}
"
,
user
)).
to_s
)
end
end
...
@@ -34,7 +34,7 @@ describe Projects::MergeRequestsController do
...
@@ -34,7 +34,7 @@ describe Projects::MergeRequestsController do
it
"should not escape Html"
do
it
"should not escape Html"
do
MergeRequest
.
any_instance
.
stub
(
:"to_
#{
format
}
"
).
and_return
(
'HTML entities &<>" '
)
MergeRequest
.
any_instance
.
stub
(
:"to_
#{
format
}
"
).
and_return
(
'HTML entities &<>" '
)
get
:show
,
project_id:
project
.
code
,
id:
merge_request
.
iid
,
format:
format
get
:show
,
project_id:
project
.
to_param
,
id:
merge_request
.
iid
,
format:
format
expect
(
response
.
body
).
to_not
include
(
'&'
)
expect
(
response
.
body
).
to_not
include
(
'&'
)
expect
(
response
.
body
).
to_not
include
(
'>'
)
expect
(
response
.
body
).
to_not
include
(
'>'
)
...
@@ -48,7 +48,7 @@ describe Projects::MergeRequestsController do
...
@@ -48,7 +48,7 @@ describe Projects::MergeRequestsController do
let
(
:format
)
{
:diff
}
let
(
:format
)
{
:diff
}
it
"should really only be a git diff"
do
it
"should really only be a git diff"
do
get
:show
,
project_id:
project
.
code
,
id:
merge_request
.
iid
,
format:
format
get
:show
,
project_id:
project
.
to_param
,
id:
merge_request
.
iid
,
format:
format
expect
(
response
.
body
).
to
start_with
(
"diff --git"
)
expect
(
response
.
body
).
to
start_with
(
"diff --git"
)
end
end
...
@@ -59,13 +59,13 @@ describe Projects::MergeRequestsController do
...
@@ -59,13 +59,13 @@ describe Projects::MergeRequestsController do
let
(
:format
)
{
:patch
}
let
(
:format
)
{
:patch
}
it
"should really be a git email patch with commit"
do
it
"should really be a git email patch with commit"
do
get
:show
,
project_id:
project
.
code
,
id:
merge_request
.
iid
,
format:
format
get
:show
,
project_id:
project
.
to_param
,
id:
merge_request
.
iid
,
format:
format
expect
(
response
.
body
[
0
..
100
]).
to
start_with
(
"From
#{
merge_request
.
commits
.
last
.
id
}
"
)
expect
(
response
.
body
[
0
..
100
]).
to
start_with
(
"From
#{
merge_request
.
commits
.
last
.
id
}
"
)
end
end
it
"should contain git diffs"
do
it
"should contain git diffs"
do
get
:show
,
project_id:
project
.
code
,
id:
merge_request
.
iid
,
format:
format
get
:show
,
project_id:
project
.
to_param
,
id:
merge_request
.
iid
,
format:
format
expect
(
response
.
body
).
to
match
(
/^diff --git/
)
expect
(
response
.
body
).
to
match
(
/^diff --git/
)
end
end
...
...
spec/controllers/tree_controller_spec.rb
View file @
df9cbbc9
...
@@ -18,7 +18,7 @@ describe Projects::TreeController do
...
@@ -18,7 +18,7 @@ describe Projects::TreeController do
# Make sure any errors accessing the tree in our views bubble up to this spec
# Make sure any errors accessing the tree in our views bubble up to this spec
render_views
render_views
before
{
get
:show
,
project_id:
project
.
code
,
id:
id
}
before
{
get
:show
,
project_id:
project
.
to_param
,
id:
id
}
context
"valid branch, no path"
do
context
"valid branch, no path"
do
let
(
:id
)
{
'master'
}
let
(
:id
)
{
'master'
}
...
...
spec/factories.rb
View file @
df9cbbc9
...
@@ -28,6 +28,7 @@ FactoryGirl.define do
...
@@ -28,6 +28,7 @@ FactoryGirl.define do
factory
:project
do
factory
:project
do
sequence
(
:name
)
{
|
n
|
"project
#{
n
}
"
}
sequence
(
:name
)
{
|
n
|
"project
#{
n
}
"
}
path
{
name
.
downcase
.
gsub
(
/\s/
,
'_'
)
}
path
{
name
.
downcase
.
gsub
(
/\s/
,
'_'
)
}
namespace
creator
creator
trait
:source
do
trait
:source
do
...
...
spec/features/atom/issues_spec.rb
View file @
df9cbbc9
...
@@ -3,7 +3,7 @@ require 'spec_helper'
...
@@ -3,7 +3,7 @@ require 'spec_helper'
describe
"Issues Feed"
do
describe
"Issues Feed"
do
describe
"GET /issues"
do
describe
"GET /issues"
do
let!
(
:user
)
{
create
(
:user
)
}
let!
(
:user
)
{
create
(
:user
)
}
let!
(
:project
)
{
create
(
:project
,
namespace:
user
.
namespace
)
}
let!
(
:project
)
{
create
(
:project
)
}
let!
(
:issue
)
{
create
(
:issue
,
author:
user
,
project:
project
)
}
let!
(
:issue
)
{
create
(
:issue
,
author:
user
,
project:
project
)
}
before
{
project
.
team
<<
[
user
,
:developer
]
}
before
{
project
.
team
<<
[
user
,
:developer
]
}
...
...
spec/models/project_spec.rb
View file @
df9cbbc9
...
@@ -58,11 +58,11 @@ describe Project do
...
@@ -58,11 +58,11 @@ describe Project do
let!
(
:project
)
{
create
(
:project
)
}
let!
(
:project
)
{
create
(
:project
)
}
it
{
should
validate_presence_of
(
:name
)
}
it
{
should
validate_presence_of
(
:name
)
}
it
{
should
validate_uniqueness_of
(
:name
)
}
it
{
should
validate_uniqueness_of
(
:name
)
.
scoped_to
(
:namespace_id
)
}
it
{
should
ensure_length_of
(
:name
).
is_within
(
0
..
255
)
}
it
{
should
ensure_length_of
(
:name
).
is_within
(
0
..
255
)
}
it
{
should
validate_presence_of
(
:path
)
}
it
{
should
validate_presence_of
(
:path
)
}
it
{
should
validate_uniqueness_of
(
:path
)
}
it
{
should
validate_uniqueness_of
(
:path
)
.
scoped_to
(
:namespace_id
)
}
it
{
should
ensure_length_of
(
:path
).
is_within
(
0
..
255
)
}
it
{
should
ensure_length_of
(
:path
).
is_within
(
0
..
255
)
}
it
{
should
ensure_length_of
(
:description
).
is_within
(
0
..
2000
)
}
it
{
should
ensure_length_of
(
:description
).
is_within
(
0
..
2000
)
}
it
{
should
validate_presence_of
(
:creator
)
}
it
{
should
validate_presence_of
(
:creator
)
}
...
@@ -157,15 +157,6 @@ describe Project do
...
@@ -157,15 +157,6 @@ describe Project do
it
{
Project
.
find_with_namespace
(
'gitlab/gitlab-ci'
).
should
==
@project
}
it
{
Project
.
find_with_namespace
(
'gitlab/gitlab-ci'
).
should
==
@project
}
it
{
Project
.
find_with_namespace
(
'gitlab-ci'
).
should
be_nil
}
it
{
Project
.
find_with_namespace
(
'gitlab-ci'
).
should
be_nil
}
end
end
context
'w/o namespace'
do
before
do
@project
=
create
(
:project
,
name:
'gitlab-ci'
)
end
it
{
Project
.
find_with_namespace
(
'gitlab-ci'
).
should
==
@project
}
it
{
Project
.
find_with_namespace
(
'gitlab/gitlab-ci'
).
should
be_nil
}
end
end
end
describe
:to_param
do
describe
:to_param
do
...
@@ -177,14 +168,6 @@ describe Project do
...
@@ -177,14 +168,6 @@ describe Project do
it
{
@project
.
to_param
.
should
==
"gitlab/gitlab-ci"
}
it
{
@project
.
to_param
.
should
==
"gitlab/gitlab-ci"
}
end
end
context
'w/o namespace'
do
before
do
@project
=
create
(
:project
,
name:
'gitlab-ci'
)
end
it
{
@project
.
to_param
.
should
==
"gitlab-ci"
}
end
end
end
describe
:repository
do
describe
:repository
do
...
...
spec/requests/api/merge_requests_spec.rb
View file @
df9cbbc9
...
@@ -2,9 +2,10 @@ require "spec_helper"
...
@@ -2,9 +2,10 @@ require "spec_helper"
describe
API
::
API
do
describe
API
::
API
do
include
ApiHelpers
include
ApiHelpers
before
(
:each
)
{
ActiveRecord
::
Base
.
observers
.
enable
(
:user_observer
)
}
after
(
:each
)
{
ActiveRecord
::
Base
.
observers
.
disable
(
:user_observer
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
let!
(
:project
)
{
create
(
:project_with_code
,
creator_id:
user
.
id
)
}
let!
(
:project
)
{
create
(
:project_with_code
,
creator_id:
user
.
id
,
namespace:
user
.
namespace
)
}
let!
(
:merge_request
)
{
create
(
:merge_request
,
author:
user
,
assignee:
user
,
source_project:
project
,
target_project:
project
,
title:
"Test"
)
}
let!
(
:merge_request
)
{
create
(
:merge_request
,
author:
user
,
assignee:
user
,
source_project:
project
,
target_project:
project
,
title:
"Test"
)
}
before
{
before
{
project
.
team
<<
[
user
,
:reporters
]
project
.
team
<<
[
user
,
:reporters
]
...
@@ -13,14 +14,14 @@ describe API::API do
...
@@ -13,14 +14,14 @@ describe API::API do
describe
"GET /projects/:id/merge_requests"
do
describe
"GET /projects/:id/merge_requests"
do
context
"when unauthenticated"
do
context
"when unauthenticated"
do
it
"should return authentication error"
do
it
"should return authentication error"
do
get
api
(
"/projects/
#{
project
.
id
}
/merge_requests"
)
get
api
(
"/projects/
#{
project
.
to_param
}
/merge_requests"
)
response
.
status
.
should
==
401
response
.
status
.
should
==
401
end
end
end
end
context
"when authenticated"
do
context
"when authenticated"
do
it
"should return an array of merge_requests"
do
it
"should return an array of merge_requests"
do
get
api
(
"/projects/
#{
project
.
id
}
/merge_requests"
,
user
)
get
api
(
"/projects/
#{
project
.
to_param
}
/merge_requests"
,
user
)
response
.
status
.
should
==
200
response
.
status
.
should
==
200
json_response
.
should
be_an
Array
json_response
.
should
be_an
Array
json_response
.
first
[
'title'
].
should
==
merge_request
.
title
json_response
.
first
[
'title'
].
should
==
merge_request
.
title
...
@@ -30,13 +31,13 @@ describe API::API do
...
@@ -30,13 +31,13 @@ describe API::API do
describe
"GET /projects/:id/merge_request/:merge_request_id"
do
describe
"GET /projects/:id/merge_request/:merge_request_id"
do
it
"should return merge_request"
do
it
"should return merge_request"
do
get
api
(
"/projects/
#{
project
.
id
}
/merge_request/
#{
merge_request
.
id
}
"
,
user
)
get
api
(
"/projects/
#{
project
.
to_param
}
/merge_request/
#{
merge_request
.
id
}
"
,
user
)
response
.
status
.
should
==
200
response
.
status
.
should
==
200
json_response
[
'title'
].
should
==
merge_request
.
title
json_response
[
'title'
].
should
==
merge_request
.
title
end
end
it
"should return a 404 error if merge_request_id not found"
do
it
"should return a 404 error if merge_request_id not found"
do
get
api
(
"/projects/
#{
project
.
id
}
/merge_request/999"
,
user
)
get
api
(
"/projects/
#{
project
.
to_param
}
/merge_request/999"
,
user
)
response
.
status
.
should
==
404
response
.
status
.
should
==
404
end
end
end
end
...
@@ -44,32 +45,32 @@ describe API::API do
...
@@ -44,32 +45,32 @@ describe API::API do
describe
"POST /projects/:id/merge_requests"
do
describe
"POST /projects/:id/merge_requests"
do
context
'between branches projects'
do
context
'between branches projects'
do
it
"should return merge_request"
do
it
"should return merge_request"
do
post
api
(
"/projects/
#{
project
.
id
}
/merge_requests"
,
user
),
post
api
(
"/projects/
#{
project
.
to_param
}
/merge_requests"
,
user
),
title:
'Test merge_request'
,
source_branch:
"stable"
,
target_branch:
"master"
,
author:
user
title:
'Test merge_request'
,
source_branch:
"stable"
,
target_branch:
"master"
,
author:
user
response
.
status
.
should
==
201
response
.
status
.
should
==
201
json_response
[
'title'
].
should
==
'Test merge_request'
json_response
[
'title'
].
should
==
'Test merge_request'
end
end
it
"should return 422 when source_branch equals target_branch"
do
it
"should return 422 when source_branch equals target_branch"
do
post
api
(
"/projects/
#{
project
.
id
}
/merge_requests"
,
user
),
post
api
(
"/projects/
#{
project
.
to_param
}
/merge_requests"
,
user
),
title:
"Test merge_request"
,
source_branch:
"master"
,
target_branch:
"master"
,
author:
user
title:
"Test merge_request"
,
source_branch:
"master"
,
target_branch:
"master"
,
author:
user
response
.
status
.
should
==
422
response
.
status
.
should
==
422
end
end
it
"should return 400 when source_branch is missing"
do
it
"should return 400 when source_branch is missing"
do
post
api
(
"/projects/
#{
project
.
id
}
/merge_requests"
,
user
),
post
api
(
"/projects/
#{
project
.
to_param
}
/merge_requests"
,
user
),
title:
"Test merge_request"
,
target_branch:
"master"
,
author:
user
title:
"Test merge_request"
,
target_branch:
"master"
,
author:
user
response
.
status
.
should
==
400
response
.
status
.
should
==
400
end
end
it
"should return 400 when target_branch is missing"
do
it
"should return 400 when target_branch is missing"
do
post
api
(
"/projects/
#{
project
.
id
}
/merge_requests"
,
user
),
post
api
(
"/projects/
#{
project
.
to_param
}
/merge_requests"
,
user
),
title:
"Test merge_request"
,
source_branch:
"stable"
,
author:
user
title:
"Test merge_request"
,
source_branch:
"stable"
,
author:
user
response
.
status
.
should
==
400
response
.
status
.
should
==
400
end
end
it
"should return 400 when title is missing"
do
it
"should return 400 when title is missing"
do
post
api
(
"/projects/
#{
project
.
id
}
/merge_requests"
,
user
),
post
api
(
"/projects/
#{
project
.
to_param
}
/merge_requests"
,
user
),
target_branch:
'master'
,
source_branch:
'stable'
target_branch:
'master'
,
source_branch:
'stable'
response
.
status
.
should
==
400
response
.
status
.
should
==
400
end
end
...
@@ -89,54 +90,54 @@ describe API::API do
...
@@ -89,54 +90,54 @@ describe API::API do
end
end
it
"should return merge_request"
do
it
"should return merge_request"
do
post
api
(
"/projects/
#{
fork_project
.
id
}
/merge_requests"
,
user2
),
post
api
(
"/projects/
#{
fork_project
.
to_param
}
/merge_requests"
,
user2
),
title:
'Test merge_request'
,
source_branch:
"stable"
,
target_branch:
"master"
,
author:
user2
,
target_project_id:
project
.
id
title:
'Test merge_request'
,
source_branch:
"stable"
,
target_branch:
"master"
,
author:
user2
,
target_project_id:
project
.
id
response
.
status
.
should
==
201
response
.
status
.
should
==
201
json_response
[
'title'
].
should
==
'Test merge_request'
json_response
[
'title'
].
should
==
'Test merge_request'
end
end
it
"should not return 422 when source_branch equals target_branch"
do
it
"should not return 422 when source_branch equals target_branch"
do
project
.
id
.
should_not
==
fork_project
.
id
project
.
to_param
.
should_not
==
fork_project
.
to_param
fork_project
.
forked?
.
should
be_true
fork_project
.
forked?
.
should
be_true
fork_project
.
forked_from_project
.
should
==
project
fork_project
.
forked_from_project
.
should
==
project
post
api
(
"/projects/
#{
fork_project
.
id
}
/merge_requests"
,
user2
),
post
api
(
"/projects/
#{
fork_project
.
to_param
}
/merge_requests"
,
user2
),
title:
'Test merge_request'
,
source_branch:
"master"
,
target_branch:
"master"
,
author:
user2
,
target_project_id:
project
.
id
title:
'Test merge_request'
,
source_branch:
"master"
,
target_branch:
"master"
,
author:
user2
,
target_project_id:
project
.
id
response
.
status
.
should
==
201
response
.
status
.
should
==
201
json_response
[
'title'
].
should
==
'Test merge_request'
json_response
[
'title'
].
should
==
'Test merge_request'
end
end
it
"should return 400 when source_branch is missing"
do
it
"should return 400 when source_branch is missing"
do
post
api
(
"/projects/
#{
fork_project
.
id
}
/merge_requests"
,
user2
),
post
api
(
"/projects/
#{
fork_project
.
to_param
}
/merge_requests"
,
user2
),
title:
'Test merge_request'
,
target_branch:
"master"
,
author:
user2
,
target_project_id:
project
.
id
title:
'Test merge_request'
,
target_branch:
"master"
,
author:
user2
,
target_project_id:
project
.
id
response
.
status
.
should
==
400
response
.
status
.
should
==
400
end
end
it
"should return 400 when target_branch is missing"
do
it
"should return 400 when target_branch is missing"
do
post
api
(
"/projects/
#{
fork_project
.
id
}
/merge_requests"
,
user2
),
post
api
(
"/projects/
#{
fork_project
.
to_param
}
/merge_requests"
,
user2
),
title:
'Test merge_request'
,
target_branch:
"master"
,
author:
user2
,
target_project_id:
project
.
id
title:
'Test merge_request'
,
target_branch:
"master"
,
author:
user2
,
target_project_id:
project
.
id
response
.
status
.
should
==
400
response
.
status
.
should
==
400
end
end
it
"should return 400 when title is missing"
do
it
"should return 400 when title is missing"
do
post
api
(
"/projects/
#{
fork_project
.
id
}
/merge_requests"
,
user2
),
post
api
(
"/projects/
#{
fork_project
.
to_param
}
/merge_requests"
,
user2
),
target_branch:
'master'
,
source_branch:
'stable'
,
author:
user2
,
target_project_id:
project
.
id
target_branch:
'master'
,
source_branch:
'stable'
,
author:
user2
,
target_project_id:
project
.
id
response
.
status
.
should
==
400
response
.
status
.
should
==
400
end
end
it
"should return 400 when target_branch is specified and not a forked project"
do
it
"should return 400 when target_branch is specified and not a forked project"
do
post
api
(
"/projects/
#{
project
.
id
}
/merge_requests"
,
user
),
post
api
(
"/projects/
#{
project
.
to_param
}
/merge_requests"
,
user
),
title:
'Test merge_request'
,
target_branch:
'master'
,
source_branch:
'stable'
,
author:
user
,
target_project_id:
fork_project
.
id
title:
'Test merge_request'
,
target_branch:
'master'
,
source_branch:
'stable'
,
author:
user
,
target_project_id:
fork_project
.
id
response
.
status
.
should
==
400
response
.
status
.
should
==
400
end
end
it
"should return 400 when target_branch is specified and for a different fork"
do
it
"should return 400 when target_branch is specified and for a different fork"
do
post
api
(
"/projects/
#{
fork_project
.
id
}
/merge_requests"
,
user2
),
post
api
(
"/projects/
#{
fork_project
.
to_param
}
/merge_requests"
,
user2
),
title:
'Test merge_request'
,
target_branch:
'master'
,
source_branch:
'stable'
,
author:
user2
,
target_project_id:
unrelated_project
.
id
title:
'Test merge_request'
,
target_branch:
'master'
,
source_branch:
'stable'
,
author:
user2
,
target_project_id:
unrelated_project
.
id
response
.
status
.
should
==
400
response
.
status
.
should
==
400
end
end
it
"should return 201 when target_branch is specified and for the same project"
do
it
"should return 201 when target_branch is specified and for the same project"
do
post
api
(
"/projects/
#{
fork_project
.
id
}
/merge_requests"
,
user2
),
post
api
(
"/projects/
#{
fork_project
.
to_param
}
/merge_requests"
,
user2
),
title:
'Test merge_request'
,
target_branch:
'master'
,
source_branch:
'stable'
,
author:
user2
,
target_project_id:
fork_project
.
id
title:
'Test merge_request'
,
target_branch:
'master'
,
source_branch:
'stable'
,
author:
user2
,
target_project_id:
fork_project
.
id
response
.
status
.
should
==
201
response
.
status
.
should
==
201
end
end
...
@@ -145,7 +146,7 @@ describe API::API do
...
@@ -145,7 +146,7 @@ describe API::API do
describe
"PUT /projects/:id/merge_request/:merge_request_id to close MR"
do
describe
"PUT /projects/:id/merge_request/:merge_request_id to close MR"
do
it
"should return merge_request"
do
it
"should return merge_request"
do
put
api
(
"/projects/
#{
project
.
id
}
/merge_request/
#{
merge_request
.
id
}
"
,
user
),
state_event:
"close"
put
api
(
"/projects/
#{
project
.
to_param
}
/merge_request/
#{
merge_request
.
id
}
"
,
user
),
state_event:
"close"
response
.
status
.
should
==
200
response
.
status
.
should
==
200
json_response
[
'state'
].
should
==
'closed'
json_response
[
'state'
].
should
==
'closed'
end
end
...
@@ -153,7 +154,7 @@ describe API::API do
...
@@ -153,7 +154,7 @@ describe API::API do
describe
"PUT /projects/:id/merge_request/:merge_request_id to merge MR"
do
describe
"PUT /projects/:id/merge_request/:merge_request_id to merge MR"
do
it
"should return merge_request"
do
it
"should return merge_request"
do
put
api
(
"/projects/
#{
project
.
id
}
/merge_request/
#{
merge_request
.
id
}
"
,
user
),
state_event:
"merge"
put
api
(
"/projects/
#{
project
.
to_param
}
/merge_request/
#{
merge_request
.
id
}
"
,
user
),
state_event:
"merge"
response
.
status
.
should
==
200
response
.
status
.
should
==
200
json_response
[
'state'
].
should
==
'merged'
json_response
[
'state'
].
should
==
'merged'
end
end
...
@@ -161,19 +162,19 @@ describe API::API do
...
@@ -161,19 +162,19 @@ describe API::API do
describe
"PUT /projects/:id/merge_request/:merge_request_id"
do
describe
"PUT /projects/:id/merge_request/:merge_request_id"
do
it
"should return merge_request"
do
it
"should return merge_request"
do
put
api
(
"/projects/
#{
project
.
id
}
/merge_request/
#{
merge_request
.
id
}
"
,
user
),
title:
"New title"
put
api
(
"/projects/
#{
project
.
to_param
}
/merge_request/
#{
merge_request
.
id
}
"
,
user
),
title:
"New title"
response
.
status
.
should
==
200
response
.
status
.
should
==
200
json_response
[
'title'
].
should
==
'New title'
json_response
[
'title'
].
should
==
'New title'
end
end
it
"should return 422 when source_branch and target_branch are renamed the same"
do
it
"should return 422 when source_branch and target_branch are renamed the same"
do
put
api
(
"/projects/
#{
project
.
id
}
/merge_request/
#{
merge_request
.
id
}
"
,
user
),
put
api
(
"/projects/
#{
project
.
to_param
}
/merge_request/
#{
merge_request
.
id
}
"
,
user
),
source_branch:
"master"
,
target_branch:
"master"
source_branch:
"master"
,
target_branch:
"master"
response
.
status
.
should
==
422
response
.
status
.
should
==
422
end
end
it
"should return merge_request with renamed target_branch"
do
it
"should return merge_request with renamed target_branch"
do
put
api
(
"/projects/
#{
project
.
id
}
/merge_request/
#{
merge_request
.
id
}
"
,
user
),
target_branch:
"wiki"
put
api
(
"/projects/
#{
project
.
to_param
}
/merge_request/
#{
merge_request
.
id
}
"
,
user
),
target_branch:
"wiki"
response
.
status
.
should
==
200
response
.
status
.
should
==
200
json_response
[
'target_branch'
].
should
==
'wiki'
json_response
[
'target_branch'
].
should
==
'wiki'
end
end
...
@@ -181,18 +182,18 @@ describe API::API do
...
@@ -181,18 +182,18 @@ describe API::API do
describe
"POST /projects/:id/merge_request/:merge_request_id/comments"
do
describe
"POST /projects/:id/merge_request/:merge_request_id/comments"
do
it
"should return comment"
do
it
"should return comment"
do
post
api
(
"/projects/
#{
project
.
id
}
/merge_request/
#{
merge_request
.
id
}
/comments"
,
user
),
note:
"My comment"
post
api
(
"/projects/
#{
project
.
to_param
}
/merge_request/
#{
merge_request
.
id
}
/comments"
,
user
),
note:
"My comment"
response
.
status
.
should
==
201
response
.
status
.
should
==
201
json_response
[
'note'
].
should
==
'My comment'
json_response
[
'note'
].
should
==
'My comment'
end
end
it
"should return 400 if note is missing"
do
it
"should return 400 if note is missing"
do
post
api
(
"/projects/
#{
project
.
id
}
/merge_request/
#{
merge_request
.
id
}
/comments"
,
user
)
post
api
(
"/projects/
#{
project
.
to_param
}
/merge_request/
#{
merge_request
.
id
}
/comments"
,
user
)
response
.
status
.
should
==
400
response
.
status
.
should
==
400
end
end
it
"should return 404 if note is attached to non existent merge request"
do
it
"should return 404 if note is attached to non existent merge request"
do
post
api
(
"/projects/
#{
project
.
id
}
/merge_request/111/comments"
,
user
),
note:
"My comment"
post
api
(
"/projects/
#{
project
.
to_param
}
/merge_request/111/comments"
,
user
),
note:
"My comment"
response
.
status
.
should
==
404
response
.
status
.
should
==
404
end
end
end
end
...
...
spec/routing/project_routing_spec.rb
View file @
df9cbbc9
...
@@ -25,31 +25,31 @@ shared_examples "RESTful project resources" do
...
@@ -25,31 +25,31 @@ shared_examples "RESTful project resources" do
let
(
:actions
)
{
[
:index
,
:create
,
:new
,
:edit
,
:show
,
:update
,
:destroy
]
}
let
(
:actions
)
{
[
:index
,
:create
,
:new
,
:edit
,
:show
,
:update
,
:destroy
]
}
it
"to #index"
do
it
"to #index"
do
get
(
"/gitlab
hq/
#{
controller
}
"
).
should
route_to
(
"projects/
#{
controller
}
#index"
,
project_id:
'
gitlabhq'
)
if
actions
.
include?
(
:index
)
get
(
"/gitlab
/gitlabhq/
#{
controller
}
"
).
should
route_to
(
"projects/
#{
controller
}
#index"
,
project_id:
'gitlab/
gitlabhq'
)
if
actions
.
include?
(
:index
)
end
end
it
"to #create"
do
it
"to #create"
do
post
(
"/gitlab
hq/
#{
controller
}
"
).
should
route_to
(
"projects/
#{
controller
}
#create"
,
project_id:
'
gitlabhq'
)
if
actions
.
include?
(
:create
)
post
(
"/gitlab
/gitlabhq/
#{
controller
}
"
).
should
route_to
(
"projects/
#{
controller
}
#create"
,
project_id:
'gitlab/
gitlabhq'
)
if
actions
.
include?
(
:create
)
end
end
it
"to #new"
do
it
"to #new"
do
get
(
"/gitlab
hq/
#{
controller
}
/new"
).
should
route_to
(
"projects/
#{
controller
}
#new"
,
project_id:
'
gitlabhq'
)
if
actions
.
include?
(
:new
)
get
(
"/gitlab
/gitlabhq/
#{
controller
}
/new"
).
should
route_to
(
"projects/
#{
controller
}
#new"
,
project_id:
'gitlab/
gitlabhq'
)
if
actions
.
include?
(
:new
)
end
end
it
"to #edit"
do
it
"to #edit"
do
get
(
"/gitlab
hq/
#{
controller
}
/1/edit"
).
should
route_to
(
"projects/
#{
controller
}
#edit"
,
project_id:
'
gitlabhq'
,
id:
'1'
)
if
actions
.
include?
(
:edit
)
get
(
"/gitlab
/gitlabhq/
#{
controller
}
/1/edit"
).
should
route_to
(
"projects/
#{
controller
}
#edit"
,
project_id:
'gitlab/
gitlabhq'
,
id:
'1'
)
if
actions
.
include?
(
:edit
)
end
end
it
"to #show"
do
it
"to #show"
do
get
(
"/gitlab
hq/
#{
controller
}
/1"
).
should
route_to
(
"projects/
#{
controller
}
#show"
,
project_id:
'
gitlabhq'
,
id:
'1'
)
if
actions
.
include?
(
:show
)
get
(
"/gitlab
/gitlabhq/
#{
controller
}
/1"
).
should
route_to
(
"projects/
#{
controller
}
#show"
,
project_id:
'gitlab/
gitlabhq'
,
id:
'1'
)
if
actions
.
include?
(
:show
)
end
end
it
"to #update"
do
it
"to #update"
do
put
(
"/gitlab
hq/
#{
controller
}
/1"
).
should
route_to
(
"projects/
#{
controller
}
#update"
,
project_id:
'
gitlabhq'
,
id:
'1'
)
if
actions
.
include?
(
:update
)
put
(
"/gitlab
/gitlabhq/
#{
controller
}
/1"
).
should
route_to
(
"projects/
#{
controller
}
#update"
,
project_id:
'gitlab/
gitlabhq'
,
id:
'1'
)
if
actions
.
include?
(
:update
)
end
end
it
"to #destroy"
do
it
"to #destroy"
do
delete
(
"/gitlab
hq/
#{
controller
}
/1"
).
should
route_to
(
"projects/
#{
controller
}
#destroy"
,
project_id:
'
gitlabhq'
,
id:
'1'
)
if
actions
.
include?
(
:destroy
)
delete
(
"/gitlab
/gitlabhq/
#{
controller
}
/1"
).
should
route_to
(
"projects/
#{
controller
}
#destroy"
,
project_id:
'gitlab/
gitlabhq'
,
id:
'1'
)
if
actions
.
include?
(
:destroy
)
end
end
end
end
...
@@ -72,31 +72,31 @@ describe ProjectsController, "routing" do
...
@@ -72,31 +72,31 @@ describe ProjectsController, "routing" do
end
end
it
"to #fork"
do
it
"to #fork"
do
post
(
"/gitlab
hq/fork"
).
should
route_to
(
'projects#fork'
,
id:
'
gitlabhq'
)
post
(
"/gitlab
/gitlabhq/fork"
).
should
route_to
(
'projects#fork'
,
id:
'gitlab/
gitlabhq'
)
end
end
it
"to #wall"
do
it
"to #wall"
do
get
(
"/gitlab
hq/wall"
).
should
route_to
(
'projects/walls#show'
,
project_id:
'
gitlabhq'
)
get
(
"/gitlab
/gitlabhq/wall"
).
should
route_to
(
'projects/walls#show'
,
project_id:
'gitlab/
gitlabhq'
)
end
end
it
"to #edit"
do
it
"to #edit"
do
get
(
"/gitlab
hq/edit"
).
should
route_to
(
'projects#edit'
,
id:
'
gitlabhq'
)
get
(
"/gitlab
/gitlabhq/edit"
).
should
route_to
(
'projects#edit'
,
id:
'gitlab/
gitlabhq'
)
end
end
it
"to #autocomplete_sources"
do
it
"to #autocomplete_sources"
do
get
(
'/gitlab
hq/autocomplete_sources'
).
should
route_to
(
'projects#autocomplete_sources'
,
id:
"
gitlabhq"
)
get
(
'/gitlab
/gitlabhq/autocomplete_sources'
).
should
route_to
(
'projects#autocomplete_sources'
,
id:
"gitlab/
gitlabhq"
)
end
end
it
"to #show"
do
it
"to #show"
do
get
(
"/gitlab
hq"
).
should
route_to
(
'projects#show'
,
id:
'
gitlabhq'
)
get
(
"/gitlab
/gitlabhq"
).
should
route_to
(
'projects#show'
,
id:
'gitlab/
gitlabhq'
)
end
end
it
"to #update"
do
it
"to #update"
do
put
(
"/gitlab
hq"
).
should
route_to
(
'projects#update'
,
id:
'
gitlabhq'
)
put
(
"/gitlab
/gitlabhq"
).
should
route_to
(
'projects#update'
,
id:
'gitlab/
gitlabhq'
)
end
end
it
"to #destroy"
do
it
"to #destroy"
do
delete
(
"/gitlab
hq"
).
should
route_to
(
'projects#destroy'
,
id:
'
gitlabhq'
)
delete
(
"/gitlab
/gitlabhq"
).
should
route_to
(
'projects#destroy'
,
id:
'gitlab/
gitlabhq'
)
end
end
end
end
...
@@ -108,11 +108,11 @@ end
...
@@ -108,11 +108,11 @@ end
# DELETE /:project_id/wikis/:id(.:format) projects/wikis#destroy
# DELETE /:project_id/wikis/:id(.:format) projects/wikis#destroy
describe
Projects
::
WikisController
,
"routing"
do
describe
Projects
::
WikisController
,
"routing"
do
it
"to #pages"
do
it
"to #pages"
do
get
(
"/gitlab
hq/wikis/pages"
).
should
route_to
(
'projects/wikis#pages'
,
project_id:
'
gitlabhq'
)
get
(
"/gitlab
/gitlabhq/wikis/pages"
).
should
route_to
(
'projects/wikis#pages'
,
project_id:
'gitlab/
gitlabhq'
)
end
end
it
"to #history"
do
it
"to #history"
do
get
(
"/gitlab
hq/wikis/1/history"
).
should
route_to
(
'projects/wikis#history'
,
project_id:
'
gitlabhq'
,
id:
'1'
)
get
(
"/gitlab
/gitlabhq/wikis/1/history"
).
should
route_to
(
'projects/wikis#history'
,
project_id:
'gitlab/
gitlabhq'
,
id:
'1'
)
end
end
it_behaves_like
"RESTful project resources"
do
it_behaves_like
"RESTful project resources"
do
...
@@ -127,23 +127,23 @@ end
...
@@ -127,23 +127,23 @@ end
# edit_project_repository GET /:project_id/repository/edit(.:format) projects/repositories#edit
# edit_project_repository GET /:project_id/repository/edit(.:format) projects/repositories#edit
describe
Projects
::
RepositoriesController
,
"routing"
do
describe
Projects
::
RepositoriesController
,
"routing"
do
it
"to #archive"
do
it
"to #archive"
do
get
(
"/gitlab
hq/repository/archive"
).
should
route_to
(
'projects/repositories#archive'
,
project_id:
'
gitlabhq'
)
get
(
"/gitlab
/gitlabhq/repository/archive"
).
should
route_to
(
'projects/repositories#archive'
,
project_id:
'gitlab/
gitlabhq'
)
end
end
it
"to #show"
do
it
"to #show"
do
get
(
"/gitlab
hq/repository"
).
should
route_to
(
'projects/repositories#show'
,
project_id:
'
gitlabhq'
)
get
(
"/gitlab
/gitlabhq/repository"
).
should
route_to
(
'projects/repositories#show'
,
project_id:
'gitlab/
gitlabhq'
)
end
end
end
end
describe
Projects
::
BranchesController
,
"routing"
do
describe
Projects
::
BranchesController
,
"routing"
do
it
"to #branches"
do
it
"to #branches"
do
get
(
"/gitlab
hq/branches"
).
should
route_to
(
'projects/branches#index'
,
project_id:
'
gitlabhq'
)
get
(
"/gitlab
/gitlabhq/branches"
).
should
route_to
(
'projects/branches#index'
,
project_id:
'gitlab/
gitlabhq'
)
end
end
end
end
describe
Projects
::
TagsController
,
"routing"
do
describe
Projects
::
TagsController
,
"routing"
do
it
"to #tags"
do
it
"to #tags"
do
get
(
"/gitlab
hq/tags"
).
should
route_to
(
'projects/tags#index'
,
project_id:
'
gitlabhq'
)
get
(
"/gitlab
/gitlabhq/tags"
).
should
route_to
(
'projects/tags#index'
,
project_id:
'gitlab/
gitlabhq'
)
end
end
end
end
...
@@ -176,16 +176,16 @@ end
...
@@ -176,16 +176,16 @@ end
# logs_file_project_ref GET /:project_id/refs/:id/logs_tree/:path(.:format) refs#logs_tree
# logs_file_project_ref GET /:project_id/refs/:id/logs_tree/:path(.:format) refs#logs_tree
describe
Projects
::
RefsController
,
"routing"
do
describe
Projects
::
RefsController
,
"routing"
do
it
"to #switch"
do
it
"to #switch"
do
get
(
"/gitlab
hq/refs/switch"
).
should
route_to
(
'projects/refs#switch'
,
project_id:
'
gitlabhq'
)
get
(
"/gitlab
/gitlabhq/refs/switch"
).
should
route_to
(
'projects/refs#switch'
,
project_id:
'gitlab/
gitlabhq'
)
end
end
it
"to #logs_tree"
do
it
"to #logs_tree"
do
get
(
"/gitlab
hq/refs/stable/logs_tree"
).
should
route_to
(
'projects/refs#logs_tree'
,
project_id:
'
gitlabhq'
,
id:
'stable'
)
get
(
"/gitlab
/gitlabhq/refs/stable/logs_tree"
).
should
route_to
(
'projects/refs#logs_tree'
,
project_id:
'gitlab/
gitlabhq'
,
id:
'stable'
)
get
(
"/gitlab
hq/refs/feature%2345/logs_tree"
).
should
route_to
(
'projects/refs#logs_tree'
,
project_id:
'
gitlabhq'
,
id:
'feature#45'
)
get
(
"/gitlab
/gitlabhq/refs/feature%2345/logs_tree"
).
should
route_to
(
'projects/refs#logs_tree'
,
project_id:
'gitlab/
gitlabhq'
,
id:
'feature#45'
)
get
(
"/gitlab
hq/refs/feature%2B45/logs_tree"
).
should
route_to
(
'projects/refs#logs_tree'
,
project_id:
'
gitlabhq'
,
id:
'feature+45'
)
get
(
"/gitlab
/gitlabhq/refs/feature%2B45/logs_tree"
).
should
route_to
(
'projects/refs#logs_tree'
,
project_id:
'gitlab/
gitlabhq'
,
id:
'feature+45'
)
get
(
"/gitlab
hq/refs/stable/logs_tree/foo/bar/baz"
).
should
route_to
(
'projects/refs#logs_tree'
,
project_id:
'
gitlabhq'
,
id:
'stable'
,
path:
'foo/bar/baz'
)
get
(
"/gitlab
/gitlabhq/refs/stable/logs_tree/foo/bar/baz"
).
should
route_to
(
'projects/refs#logs_tree'
,
project_id:
'gitlab/
gitlabhq'
,
id:
'stable'
,
path:
'foo/bar/baz'
)
get
(
"/gitlab
hq/refs/feature%2345/logs_tree/foo/bar/baz"
).
should
route_to
(
'projects/refs#logs_tree'
,
project_id:
'
gitlabhq'
,
id:
'feature#45'
,
path:
'foo/bar/baz'
)
get
(
"/gitlab
/gitlabhq/refs/feature%2345/logs_tree/foo/bar/baz"
).
should
route_to
(
'projects/refs#logs_tree'
,
project_id:
'gitlab/
gitlabhq'
,
id:
'feature#45'
,
path:
'foo/bar/baz'
)
get
(
"/gitlab
hq/refs/feature%2B45/logs_tree/foo/bar/baz"
).
should
route_to
(
'projects/refs#logs_tree'
,
project_id:
'
gitlabhq'
,
id:
'feature+45'
,
path:
'foo/bar/baz'
)
get
(
"/gitlab
/gitlabhq/refs/feature%2B45/logs_tree/foo/bar/baz"
).
should
route_to
(
'projects/refs#logs_tree'
,
project_id:
'gitlab/
gitlabhq'
,
id:
'feature+45'
,
path:
'foo/bar/baz'
)
get
(
"/gitlab/gitlabhq/refs/stable/logs_tree/files.scss"
).
should
route_to
(
'projects/refs#logs_tree'
,
project_id:
'gitlab/gitlabhq'
,
id:
'stable'
,
path:
'files.scss'
)
get
(
"/gitlab/gitlabhq/refs/stable/logs_tree/files.scss"
).
should
route_to
(
'projects/refs#logs_tree'
,
project_id:
'gitlab/gitlabhq'
,
id:
'stable'
,
path:
'files.scss'
)
end
end
end
end
...
@@ -204,28 +204,28 @@ end
...
@@ -204,28 +204,28 @@ end
# DELETE /:project_id/merge_requests/:id(.:format) projects/merge_requests#destroy
# DELETE /:project_id/merge_requests/:id(.:format) projects/merge_requests#destroy
describe
Projects
::
MergeRequestsController
,
"routing"
do
describe
Projects
::
MergeRequestsController
,
"routing"
do
it
"to #diffs"
do
it
"to #diffs"
do
get
(
"/gitlab
hq/merge_requests/1/diffs"
).
should
route_to
(
'projects/merge_requests#diffs'
,
project_id:
'
gitlabhq'
,
id:
'1'
)
get
(
"/gitlab
/gitlabhq/merge_requests/1/diffs"
).
should
route_to
(
'projects/merge_requests#diffs'
,
project_id:
'gitlab/
gitlabhq'
,
id:
'1'
)
end
end
it
"to #automerge"
do
it
"to #automerge"
do
get
(
"/gitlab
hq/merge_requests/1/automerge"
).
should
route_to
(
'projects/merge_requests#automerge'
,
project_id:
'
gitlabhq'
,
id:
'1'
)
get
(
"/gitlab
/gitlabhq/merge_requests/1/automerge"
).
should
route_to
(
'projects/merge_requests#automerge'
,
project_id:
'gitlab/
gitlabhq'
,
id:
'1'
)
end
end
it
"to #automerge_check"
do
it
"to #automerge_check"
do
get
(
"/gitlab
hq/merge_requests/1/automerge_check"
).
should
route_to
(
'projects/merge_requests#automerge_check'
,
project_id:
'
gitlabhq'
,
id:
'1'
)
get
(
"/gitlab
/gitlabhq/merge_requests/1/automerge_check"
).
should
route_to
(
'projects/merge_requests#automerge_check'
,
project_id:
'gitlab/
gitlabhq'
,
id:
'1'
)
end
end
it
"to #branch_from"
do
it
"to #branch_from"
do
get
(
"/gitlab
hq/merge_requests/branch_from"
).
should
route_to
(
'projects/merge_requests#branch_from'
,
project_id:
'
gitlabhq'
)
get
(
"/gitlab
/gitlabhq/merge_requests/branch_from"
).
should
route_to
(
'projects/merge_requests#branch_from'
,
project_id:
'gitlab/
gitlabhq'
)
end
end
it
"to #branch_to"
do
it
"to #branch_to"
do
get
(
"/gitlab
hq/merge_requests/branch_to"
).
should
route_to
(
'projects/merge_requests#branch_to'
,
project_id:
'
gitlabhq'
)
get
(
"/gitlab
/gitlabhq/merge_requests/branch_to"
).
should
route_to
(
'projects/merge_requests#branch_to'
,
project_id:
'gitlab/
gitlabhq'
)
end
end
it
"to #show"
do
it
"to #show"
do
get
(
"/gitlab
hq/merge_requests/1.diff"
).
should
route_to
(
'projects/merge_requests#show'
,
project_id:
'
gitlabhq'
,
id:
'1'
,
format:
'diff'
)
get
(
"/gitlab
/gitlabhq/merge_requests/1.diff"
).
should
route_to
(
'projects/merge_requests#show'
,
project_id:
'gitlab/
gitlabhq'
,
id:
'1'
,
format:
'diff'
)
get
(
"/gitlab
hq/merge_requests/1.patch"
).
should
route_to
(
'projects/merge_requests#show'
,
project_id:
'
gitlabhq'
,
id:
'1'
,
format:
'patch'
)
get
(
"/gitlab
/gitlabhq/merge_requests/1.patch"
).
should
route_to
(
'projects/merge_requests#show'
,
project_id:
'gitlab/
gitlabhq'
,
id:
'1'
,
format:
'patch'
)
end
end
it_behaves_like
"RESTful project resources"
do
it_behaves_like
"RESTful project resources"
do
...
@@ -244,35 +244,35 @@ end
...
@@ -244,35 +244,35 @@ end
# DELETE /:project_id/snippets/:id(.:format) snippets#destroy
# DELETE /:project_id/snippets/:id(.:format) snippets#destroy
describe
SnippetsController
,
"routing"
do
describe
SnippetsController
,
"routing"
do
it
"to #raw"
do
it
"to #raw"
do
get
(
"/gitlab
hq/snippets/1/raw"
).
should
route_to
(
'projects/snippets#raw'
,
project_id:
'
gitlabhq'
,
id:
'1'
)
get
(
"/gitlab
/gitlabhq/snippets/1/raw"
).
should
route_to
(
'projects/snippets#raw'
,
project_id:
'gitlab/
gitlabhq'
,
id:
'1'
)
end
end
it
"to #index"
do
it
"to #index"
do
get
(
"/gitlab
hq/snippets"
).
should
route_to
(
"projects/snippets#index"
,
project_id:
'
gitlabhq'
)
get
(
"/gitlab
/gitlabhq/snippets"
).
should
route_to
(
"projects/snippets#index"
,
project_id:
'gitlab/
gitlabhq'
)
end
end
it
"to #create"
do
it
"to #create"
do
post
(
"/gitlab
hq/snippets"
).
should
route_to
(
"projects/snippets#create"
,
project_id:
'
gitlabhq'
)
post
(
"/gitlab
/gitlabhq/snippets"
).
should
route_to
(
"projects/snippets#create"
,
project_id:
'gitlab/
gitlabhq'
)
end
end
it
"to #new"
do
it
"to #new"
do
get
(
"/gitlab
hq/snippets/new"
).
should
route_to
(
"projects/snippets#new"
,
project_id:
'
gitlabhq'
)
get
(
"/gitlab
/gitlabhq/snippets/new"
).
should
route_to
(
"projects/snippets#new"
,
project_id:
'gitlab/
gitlabhq'
)
end
end
it
"to #edit"
do
it
"to #edit"
do
get
(
"/gitlab
hq/snippets/1/edit"
).
should
route_to
(
"projects/snippets#edit"
,
project_id:
'
gitlabhq'
,
id:
'1'
)
get
(
"/gitlab
/gitlabhq/snippets/1/edit"
).
should
route_to
(
"projects/snippets#edit"
,
project_id:
'gitlab/
gitlabhq'
,
id:
'1'
)
end
end
it
"to #show"
do
it
"to #show"
do
get
(
"/gitlab
hq/snippets/1"
).
should
route_to
(
"projects/snippets#show"
,
project_id:
'
gitlabhq'
,
id:
'1'
)
get
(
"/gitlab
/gitlabhq/snippets/1"
).
should
route_to
(
"projects/snippets#show"
,
project_id:
'gitlab/
gitlabhq'
,
id:
'1'
)
end
end
it
"to #update"
do
it
"to #update"
do
put
(
"/gitlab
hq/snippets/1"
).
should
route_to
(
"projects/snippets#update"
,
project_id:
'
gitlabhq'
,
id:
'1'
)
put
(
"/gitlab
/gitlabhq/snippets/1"
).
should
route_to
(
"projects/snippets#update"
,
project_id:
'gitlab/
gitlabhq'
,
id:
'1'
)
end
end
it
"to #destroy"
do
it
"to #destroy"
do
delete
(
"/gitlab
hq/snippets/1"
).
should
route_to
(
"projects/snippets#destroy"
,
project_id:
'
gitlabhq'
,
id:
'1'
)
delete
(
"/gitlab
/gitlabhq/snippets/1"
).
should
route_to
(
"projects/snippets#destroy"
,
project_id:
'gitlab/
gitlabhq'
,
id:
'1'
)
end
end
end
end
...
@@ -282,7 +282,7 @@ end
...
@@ -282,7 +282,7 @@ end
# project_hook DELETE /:project_id/hooks/:id(.:format) hooks#destroy
# project_hook DELETE /:project_id/hooks/:id(.:format) hooks#destroy
describe
Projects
::
HooksController
,
"routing"
do
describe
Projects
::
HooksController
,
"routing"
do
it
"to #test"
do
it
"to #test"
do
get
(
"/gitlab
hq/hooks/1/test"
).
should
route_to
(
'projects/hooks#test'
,
project_id:
'
gitlabhq'
,
id:
'1'
)
get
(
"/gitlab
/gitlabhq/hooks/1/test"
).
should
route_to
(
'projects/hooks#test'
,
project_id:
'gitlab/
gitlabhq'
,
id:
'1'
)
end
end
it_behaves_like
"RESTful project resources"
do
it_behaves_like
"RESTful project resources"
do
...
@@ -294,10 +294,10 @@ end
...
@@ -294,10 +294,10 @@ end
# project_commit GET /:project_id/commit/:id(.:format) commit#show {id: /[[:alnum:]]{6,40}/, project_id: /[^\/]+/}
# project_commit GET /:project_id/commit/:id(.:format) commit#show {id: /[[:alnum:]]{6,40}/, project_id: /[^\/]+/}
describe
Projects
::
CommitController
,
"routing"
do
describe
Projects
::
CommitController
,
"routing"
do
it
"to #show"
do
it
"to #show"
do
get
(
"/gitlab
hq/commit/4246fb"
).
should
route_to
(
'projects/commit#show'
,
project_id:
'
gitlabhq'
,
id:
'4246fb'
)
get
(
"/gitlab
/gitlabhq/commit/4246fb"
).
should
route_to
(
'projects/commit#show'
,
project_id:
'gitlab/
gitlabhq'
,
id:
'4246fb'
)
get
(
"/gitlab
hq/commit/4246fb.diff"
).
should
route_to
(
'projects/commit#show'
,
project_id:
'
gitlabhq'
,
id:
'4246fb'
,
format:
'diff'
)
get
(
"/gitlab
/gitlabhq/commit/4246fb.diff"
).
should
route_to
(
'projects/commit#show'
,
project_id:
'gitlab/
gitlabhq'
,
id:
'4246fb'
,
format:
'diff'
)
get
(
"/gitlab
hq/commit/4246fb.patch"
).
should
route_to
(
'projects/commit#show'
,
project_id:
'
gitlabhq'
,
id:
'4246fb'
,
format:
'patch'
)
get
(
"/gitlab
/gitlabhq/commit/4246fb.patch"
).
should
route_to
(
'projects/commit#show'
,
project_id:
'gitlab/
gitlabhq'
,
id:
'4246fb'
,
format:
'patch'
)
get
(
"/gitlab
hq/commit/4246fbd13872934f72a8fd0d6fb1317b47b59cb5"
).
should
route_to
(
'projects/commit#show'
,
project_id:
'
gitlabhq'
,
id:
'4246fbd13872934f72a8fd0d6fb1317b47b59cb5'
)
get
(
"/gitlab
/gitlabhq/commit/4246fbd13872934f72a8fd0d6fb1317b47b59cb5"
).
should
route_to
(
'projects/commit#show'
,
project_id:
'gitlab/
gitlabhq'
,
id:
'4246fbd13872934f72a8fd0d6fb1317b47b59cb5'
)
end
end
end
end
...
@@ -347,7 +347,7 @@ end
...
@@ -347,7 +347,7 @@ end
# project_labels GET /:project_id/labels(.:format) labels#index
# project_labels GET /:project_id/labels(.:format) labels#index
describe
Projects
::
LabelsController
,
"routing"
do
describe
Projects
::
LabelsController
,
"routing"
do
it
"to #index"
do
it
"to #index"
do
get
(
"/gitlab
hq/labels"
).
should
route_to
(
'projects/labels#index'
,
project_id:
'
gitlabhq'
)
get
(
"/gitlab
/gitlabhq/labels"
).
should
route_to
(
'projects/labels#index'
,
project_id:
'gitlab/
gitlabhq'
)
end
end
end
end
...
@@ -363,7 +363,7 @@ end
...
@@ -363,7 +363,7 @@ end
# DELETE /:project_id/issues/:id(.:format) issues#destroy
# DELETE /:project_id/issues/:id(.:format) issues#destroy
describe
Projects
::
IssuesController
,
"routing"
do
describe
Projects
::
IssuesController
,
"routing"
do
it
"to #bulk_update"
do
it
"to #bulk_update"
do
post
(
"/gitlab
hq/issues/bulk_update"
).
should
route_to
(
'projects/issues#bulk_update'
,
project_id:
'
gitlabhq'
)
post
(
"/gitlab
/gitlabhq/issues/bulk_update"
).
should
route_to
(
'projects/issues#bulk_update'
,
project_id:
'gitlab/
gitlabhq'
)
end
end
it_behaves_like
"RESTful project resources"
do
it_behaves_like
"RESTful project resources"
do
...
@@ -378,7 +378,7 @@ end
...
@@ -378,7 +378,7 @@ end
# project_note DELETE /:project_id/notes/:id(.:format) notes#destroy
# project_note DELETE /:project_id/notes/:id(.:format) notes#destroy
describe
Projects
::
NotesController
,
"routing"
do
describe
Projects
::
NotesController
,
"routing"
do
it
"to #preview"
do
it
"to #preview"
do
post
(
"/gitlab
hq/notes/preview"
).
should
route_to
(
'projects/notes#preview'
,
project_id:
'
gitlabhq'
)
post
(
"/gitlab
/gitlabhq/notes/preview"
).
should
route_to
(
'projects/notes#preview'
,
project_id:
'gitlab/
gitlabhq'
)
end
end
it_behaves_like
"RESTful project resources"
do
it_behaves_like
"RESTful project resources"
do
...
@@ -390,7 +390,7 @@ end
...
@@ -390,7 +390,7 @@ end
# project_blame GET /:project_id/blame/:id(.:format) blame#show {id: /.+/, project_id: /[^\/]+/}
# project_blame GET /:project_id/blame/:id(.:format) blame#show {id: /.+/, project_id: /[^\/]+/}
describe
Projects
::
BlameController
,
"routing"
do
describe
Projects
::
BlameController
,
"routing"
do
it
"to #show"
do
it
"to #show"
do
get
(
"/gitlab
hq/blame/master/app/models/project.rb"
).
should
route_to
(
'projects/blame#show'
,
project_id:
'
gitlabhq'
,
id:
'master/app/models/project.rb'
)
get
(
"/gitlab
/gitlabhq/blame/master/app/models/project.rb"
).
should
route_to
(
'projects/blame#show'
,
project_id:
'gitlab/
gitlabhq'
,
id:
'master/app/models/project.rb'
)
get
(
"/gitlab/gitlabhq/blame/master/files.scss"
).
should
route_to
(
'projects/blame#show'
,
project_id:
'gitlab/gitlabhq'
,
id:
'master/files.scss'
)
get
(
"/gitlab/gitlabhq/blame/master/files.scss"
).
should
route_to
(
'projects/blame#show'
,
project_id:
'gitlab/gitlabhq'
,
id:
'master/files.scss'
)
end
end
end
end
...
@@ -398,8 +398,8 @@ end
...
@@ -398,8 +398,8 @@ end
# project_blob GET /:project_id/blob/:id(.:format) blob#show {id: /.+/, project_id: /[^\/]+/}
# project_blob GET /:project_id/blob/:id(.:format) blob#show {id: /.+/, project_id: /[^\/]+/}
describe
Projects
::
BlobController
,
"routing"
do
describe
Projects
::
BlobController
,
"routing"
do
it
"to #show"
do
it
"to #show"
do
get
(
"/gitlab
hq/blob/master/app/models/project.rb"
).
should
route_to
(
'projects/blob#show'
,
project_id:
'
gitlabhq'
,
id:
'master/app/models/project.rb'
)
get
(
"/gitlab
/gitlabhq/blob/master/app/models/project.rb"
).
should
route_to
(
'projects/blob#show'
,
project_id:
'gitlab/
gitlabhq'
,
id:
'master/app/models/project.rb'
)
get
(
"/gitlab
hq/blob/master/app/models/compare.rb"
).
should
route_to
(
'projects/blob#show'
,
project_id:
'
gitlabhq'
,
id:
'master/app/models/compare.rb'
)
get
(
"/gitlab
/gitlabhq/blob/master/app/models/compare.rb"
).
should
route_to
(
'projects/blob#show'
,
project_id:
'gitlab/
gitlabhq'
,
id:
'master/app/models/compare.rb'
)
get
(
"/gitlab/gitlabhq/blob/master/files.scss"
).
should
route_to
(
'projects/blob#show'
,
project_id:
'gitlab/gitlabhq'
,
id:
'master/files.scss'
)
get
(
"/gitlab/gitlabhq/blob/master/files.scss"
).
should
route_to
(
'projects/blob#show'
,
project_id:
'gitlab/gitlabhq'
,
id:
'master/files.scss'
)
end
end
end
end
...
@@ -407,7 +407,7 @@ end
...
@@ -407,7 +407,7 @@ end
# project_tree GET /:project_id/tree/:id(.:format) tree#show {id: /.+/, project_id: /[^\/]+/}
# project_tree GET /:project_id/tree/:id(.:format) tree#show {id: /.+/, project_id: /[^\/]+/}
describe
Projects
::
TreeController
,
"routing"
do
describe
Projects
::
TreeController
,
"routing"
do
it
"to #show"
do
it
"to #show"
do
get
(
"/gitlab
hq/tree/master/app/models/project.rb"
).
should
route_to
(
'projects/tree#show'
,
project_id:
'
gitlabhq'
,
id:
'master/app/models/project.rb'
)
get
(
"/gitlab
/gitlabhq/tree/master/app/models/project.rb"
).
should
route_to
(
'projects/tree#show'
,
project_id:
'gitlab/
gitlabhq'
,
id:
'master/app/models/project.rb'
)
get
(
"/gitlab/gitlabhq/tree/master/files.scss"
).
should
route_to
(
'projects/tree#show'
,
project_id:
'gitlab/gitlabhq'
,
id:
'master/files.scss'
)
get
(
"/gitlab/gitlabhq/tree/master/files.scss"
).
should
route_to
(
'projects/tree#show'
,
project_id:
'gitlab/gitlabhq'
,
id:
'master/files.scss'
)
end
end
end
end
...
@@ -417,28 +417,28 @@ end
...
@@ -417,28 +417,28 @@ end
# project_compare /:project_id/compare/:from...:to(.:format) compare#show {from: /.+/, to: /.+/, id: /[^\/]+/, project_id: /[^\/]+/}
# project_compare /:project_id/compare/:from...:to(.:format) compare#show {from: /.+/, to: /.+/, id: /[^\/]+/, project_id: /[^\/]+/}
describe
Projects
::
CompareController
,
"routing"
do
describe
Projects
::
CompareController
,
"routing"
do
it
"to #index"
do
it
"to #index"
do
get
(
"/gitlab
hq/compare"
).
should
route_to
(
'projects/compare#index'
,
project_id:
'
gitlabhq'
)
get
(
"/gitlab
/gitlabhq/compare"
).
should
route_to
(
'projects/compare#index'
,
project_id:
'gitlab/
gitlabhq'
)
end
end
it
"to #compare"
do
it
"to #compare"
do
post
(
"/gitlab
hq/compare"
).
should
route_to
(
'projects/compare#create'
,
project_id:
'
gitlabhq'
)
post
(
"/gitlab
/gitlabhq/compare"
).
should
route_to
(
'projects/compare#create'
,
project_id:
'gitlab/
gitlabhq'
)
end
end
it
"to #show"
do
it
"to #show"
do
get
(
"/gitlab
hq/compare/master...stable"
).
should
route_to
(
'projects/compare#show'
,
project_id:
'
gitlabhq'
,
from:
'master'
,
to:
'stable'
)
get
(
"/gitlab
/gitlabhq/compare/master...stable"
).
should
route_to
(
'projects/compare#show'
,
project_id:
'gitlab/
gitlabhq'
,
from:
'master'
,
to:
'stable'
)
get
(
"/gitlab
hq/compare/issue/1234...stable"
).
should
route_to
(
'projects/compare#show'
,
project_id:
'
gitlabhq'
,
from:
'issue/1234'
,
to:
'stable'
)
get
(
"/gitlab
/gitlabhq/compare/issue/1234...stable"
).
should
route_to
(
'projects/compare#show'
,
project_id:
'gitlab/
gitlabhq'
,
from:
'issue/1234'
,
to:
'stable'
)
end
end
end
end
describe
Projects
::
NetworkController
,
"routing"
do
describe
Projects
::
NetworkController
,
"routing"
do
it
"to #show"
do
it
"to #show"
do
get
(
"/gitlab
hq/network/master"
).
should
route_to
(
'projects/network#show'
,
project_id:
'
gitlabhq'
,
id:
'master'
)
get
(
"/gitlab
/gitlabhq/network/master"
).
should
route_to
(
'projects/network#show'
,
project_id:
'gitlab/
gitlabhq'
,
id:
'master'
)
get
(
"/gitlab
hq/network/master.json"
).
should
route_to
(
'projects/network#show'
,
project_id:
'
gitlabhq'
,
id:
'master'
,
format:
"json"
)
get
(
"/gitlab
/gitlabhq/network/master.json"
).
should
route_to
(
'projects/network#show'
,
project_id:
'gitlab/
gitlabhq'
,
id:
'master'
,
format:
"json"
)
end
end
end
end
describe
Projects
::
GraphsController
,
"routing"
do
describe
Projects
::
GraphsController
,
"routing"
do
it
"to #show"
do
it
"to #show"
do
get
(
"/gitlab
hq/graphs/master"
).
should
route_to
(
'projects/graphs#show'
,
project_id:
'
gitlabhq'
,
id:
'master'
)
get
(
"/gitlab
/gitlabhq/graphs/master"
).
should
route_to
(
'projects/graphs#show'
,
project_id:
'gitlab/
gitlabhq'
,
id:
'master'
)
end
end
end
end
spec/routing/routing_spec.rb
View file @
df9cbbc9
...
@@ -11,11 +11,11 @@ end
...
@@ -11,11 +11,11 @@ end
# /:path Grack
# /:path Grack
describe
"Mounted Apps"
,
"routing"
do
describe
"Mounted Apps"
,
"routing"
do
it
"to API"
do
it
"to API"
do
get
(
"/api"
).
should
be_routable
get
(
"/api
/issues
"
).
should
be_routable
end
end
it
"to Grack"
do
it
"to Grack"
do
get
(
"/gitlabhq.git"
).
should
be_routable
get
(
"/gitlab
/gitlab
hq.git"
).
should
be_routable
end
end
end
end
...
...
spec/services/git_push_service_spec.rb
View file @
df9cbbc9
...
@@ -48,7 +48,7 @@ describe GitPushService do
...
@@ -48,7 +48,7 @@ describe GitPushService do
it
{
should
include
(
id:
@commit
.
id
)
}
it
{
should
include
(
id:
@commit
.
id
)
}
it
{
should
include
(
message:
@commit
.
safe_message
)
}
it
{
should
include
(
message:
@commit
.
safe_message
)
}
it
{
should
include
(
timestamp:
@commit
.
date
.
xmlschema
)
}
it
{
should
include
(
timestamp:
@commit
.
date
.
xmlschema
)
}
it
{
should
include
(
url:
"
#{
Gitlab
.
config
.
gitlab
.
url
}
/
#{
project
.
code
}
/commit/
#{
@commit
.
id
}
"
)
}
it
{
should
include
(
url:
"
#{
Gitlab
.
config
.
gitlab
.
url
}
/
#{
project
.
to_param
}
/commit/
#{
@commit
.
id
}
"
)
}
context
"with a author"
do
context
"with a author"
do
subject
{
@push_data
[
:commits
].
first
[
:author
]
}
subject
{
@push_data
[
:commits
].
first
[
:author
]
}
...
...
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