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
591e1836
Commit
591e1836
authored
Nov 03, 2016
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests for project#index routing
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
314ef630
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
spec/controllers/projects_controller_spec.rb
spec/controllers/projects_controller_spec.rb
+20
-0
No files found.
spec/controllers/projects_controller_spec.rb
View file @
591e1836
...
...
@@ -7,6 +7,26 @@ describe ProjectsController do
let
(
:jpg
)
{
fixture_file_upload
(
Rails
.
root
+
'spec/fixtures/rails_sample.jpg'
,
'image/jpg'
)
}
let
(
:txt
)
{
fixture_file_upload
(
Rails
.
root
+
'spec/fixtures/doc_sample.txt'
,
'text/plain'
)
}
describe
'GET index'
do
context
'as a user'
do
it
'redirects to root page'
do
sign_in
(
user
)
get
:index
expect
(
response
).
to
redirect_to
(
root_path
)
end
end
context
'as a guest'
do
it
'redirects to Explore page'
do
get
:index
expect
(
response
).
to
redirect_to
(
explore_root_path
)
end
end
end
describe
"GET show"
do
context
"user not project member"
do
before
{
sign_in
(
user
)
}
...
...
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