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
Jérome Perrin
gitlab-ce
Commits
e87f2380
Commit
e87f2380
authored
Jul 08, 2014
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests for redirects.
parent
005752e4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
0 deletions
+27
-0
spec/controllers/blob_controller_spec.rb
spec/controllers/blob_controller_spec.rb
+14
-0
spec/controllers/tree_controller_spec.rb
spec/controllers/tree_controller_spec.rb
+13
-0
No files found.
spec/controllers/blob_controller_spec.rb
View file @
e87f2380
...
@@ -34,4 +34,18 @@ describe Projects::BlobController do
...
@@ -34,4 +34,18 @@ describe Projects::BlobController do
it
{
should
respond_with
(
:not_found
)
}
it
{
should
respond_with
(
:not_found
)
}
end
end
end
end
describe
'GET show with tree path'
do
render_views
before
do
get
:show
,
project_id:
project
.
to_param
,
id:
id
controller
.
instance_variable_set
(
:@blob
,
nil
)
end
context
'redirect to tree'
do
let
(
:id
)
{
'master/doc'
}
it
{
should
redirect_to
(
"/
#{
project
.
path_with_namespace
}
/tree/master/doc"
)
}
end
end
end
end
spec/controllers/tree_controller_spec.rb
View file @
e87f2380
...
@@ -40,4 +40,17 @@ describe Projects::TreeController do
...
@@ -40,4 +40,17 @@ describe Projects::TreeController do
it
{
should
respond_with
(
:not_found
)
}
it
{
should
respond_with
(
:not_found
)
}
end
end
end
end
describe
'GET show with blob path'
do
render_views
before
do
get
:show
,
project_id:
project
.
to_param
,
id:
id
end
context
'redirect to blob'
do
let
(
:id
)
{
'master/README.md'
}
it
{
should
redirect_to
(
"/
#{
project
.
path_with_namespace
}
/blob/master/README.md"
)
}
end
end
end
end
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