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
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
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
app/controllers/users_controller.rb
app/controllers/users_controller.rb
+3
-1
spec/controllers/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
class
UsersController
<
ApplicationController
skip_before_filter
:authenticate_user!
before_filter
:set_user
layout
:determine_layout
layout
:determine_layout
def
show
def
show
...
@@ -47,7 +49,7 @@ class UsersController < ApplicationController
...
@@ -47,7 +49,7 @@ class UsersController < ApplicationController
private
private
def
authenticate_user!
def
set_user
@user
=
User
.
find_by_username!
(
params
[
:username
])
@user
=
User
.
find_by_username!
(
params
[
:username
])
unless
current_user
||
@user
.
public_profile?
unless
current_user
||
@user
.
public_profile?
...
...
spec/controllers/users_controller_spec.rb
View file @
08582f15
...
@@ -9,18 +9,18 @@ describe UsersController do
...
@@ -9,18 +9,18 @@ describe UsersController do
describe
"GET #show"
do
describe
"GET #show"
do
render_views
render_views
before
do
get
:show
,
username:
user
.
username
end
it
"renders the show template"
do
it
"renders the show template"
do
get
:show
,
username:
user
.
username
expect
(
response
.
status
).
to
eq
(
200
)
expect
(
response
.
status
).
to
eq
(
200
)
expect
(
response
).
to
render_template
(
"show"
)
expect
(
response
).
to
render_template
(
"show"
)
end
end
end
describe
"GET #calendar"
do
it
"renders calendar"
do
it
"renders calendar"
do
controller
.
prepend_view_path
'app/views/users'
get
:calendar
,
username:
user
.
username
expect
(
response
).
to
render_template
(
"
_
calendar"
)
expect
(
response
).
to
render_template
(
"calendar"
)
end
end
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