BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
08582f15
Commit
08582f15
authored
Jan 29, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve user calendar authentification and tests
parent
1f0e1656
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
users_controller.rb
app/controllers/users_controller.rb
+3
-1
users_controller_spec.rb
spec/controllers/users_controller_spec.rb
+5
-5
No files found.
app/controllers/users_controller.rb
View file @
08582f15
class
UsersController
<
ApplicationController
skip_before_filter
:authenticate_user!
before_filter
:set_user
layout
:determine_layout
def
show
...
...
@@ -47,7 +49,7 @@ class UsersController < ApplicationController
private
def
authenticate_user!
def
set_user
@user
=
User
.
find_by_username!
(
params
[
:username
])
unless
current_user
||
@user
.
public_profile?
...
...
spec/controllers/users_controller_spec.rb
View file @
08582f15
...
...
@@ -9,18 +9,18 @@ describe UsersController do
describe
"GET #show"
do
render_views
before
do
get
:show
,
username:
user
.
username
end
it
"renders the show template"
do
get
:show
,
username:
user
.
username
expect
(
response
.
status
).
to
eq
(
200
)
expect
(
response
).
to
render_template
(
"show"
)
end
end
describe
"GET #calendar"
do
it
"renders calendar"
do
controller
.
prepend_view_path
'app/views/users'
expect
(
response
).
to
render_template
(
"
_
calendar"
)
get
:calendar
,
username:
user
.
username
expect
(
response
).
to
render_template
(
"calendar"
)
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