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
Léo-Paul Géneau
gitlab-ce
Commits
6781c1b4
Commit
6781c1b4
authored
May 08, 2016
by
Long Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add specs for user routing and update spec for user controller
parent
29089352
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
0 deletions
+59
-0
spec/controllers/users_controller_spec.rb
spec/controllers/users_controller_spec.rb
+22
-0
spec/routing/routing_spec.rb
spec/routing/routing_spec.rb
+37
-0
No files found.
spec/controllers/users_controller_spec.rb
View file @
6781c1b4
...
@@ -112,4 +112,26 @@ describe UsersController do
...
@@ -112,4 +112,26 @@ describe UsersController do
expect
(
response
).
to
render_template
(
'calendar_activities'
)
expect
(
response
).
to
render_template
(
'calendar_activities'
)
end
end
end
end
describe
'GET #snippets'
do
before
do
sign_in
(
user
)
end
context
'format html'
do
it
'renders snippets page'
do
get
:snippets
,
username:
user
.
username
expect
(
response
.
status
).
to
eq
(
200
)
expect
(
response
).
to
render_template
(
'show'
)
end
end
context
'format json'
do
it
'response with snippets json data'
do
get
:snippets
,
username:
user
.
username
,
format: :json
expect
(
response
.
status
).
to
eq
(
200
)
expect
(
JSON
.
parse
(
response
.
body
)).
to
have_key
(
'html'
)
end
end
end
end
end
spec/routing/routing_spec.rb
View file @
6781c1b4
require
'spec_helper'
require
'spec_helper'
# user GET /u/:username/
# user_groups GET /u/:username/groups(.:format)
# user_projects GET /u/:username/projects(.:format)
# user_contributed_projects GET /u/:username/contributed(.:format)
# user_snippets GET /u/:username/snippets(.:format)
# user_calendar GET /u/:username/calendar(.:format)
# user_calendar_activities GET /u/:username/calendar_activities(.:format)
describe
UsersController
,
"routing"
do
it
"to #show"
do
expect
(
get
(
"/u/User"
)).
to
route_to
(
'users#show'
,
username:
'User'
)
end
it
"to #groups"
do
expect
(
get
(
"/u/User/groups"
)).
to
route_to
(
'users#groups'
,
username:
'User'
)
end
it
"to #projects"
do
expect
(
get
(
"/u/User/projects"
)).
to
route_to
(
'users#projects'
,
username:
'User'
)
end
it
"to #contributed"
do
expect
(
get
(
"/u/User/contributed"
)).
to
route_to
(
'users#contributed'
,
username:
'User'
)
end
it
"to #snippets"
do
expect
(
get
(
"/u/User/snippets"
)).
to
route_to
(
'users#snippets'
,
username:
'User'
)
end
it
"to #calendar"
do
expect
(
get
(
"/u/User/calendar"
)).
to
route_to
(
'users#calendar'
,
username:
'User'
)
end
it
"to #calendar_activities"
do
expect
(
get
(
"/u/User/calendar_activities"
)).
to
route_to
(
'users#calendar_activities'
,
username:
'User'
)
end
end
# search GET /search(.:format) search#show
# search GET /search(.:format) search#show
describe
SearchController
,
"routing"
do
describe
SearchController
,
"routing"
do
it
"to #show"
do
it
"to #show"
do
...
...
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