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
04bb82c8
Commit
04bb82c8
authored
Jun 15, 2017
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update preferences controller
parent
94980852
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
preferences_controller.rb
app/controllers/profiles/preferences_controller.rb
+3
-1
preferences_controller_spec.rb
spec/controllers/profiles/preferences_controller_spec.rb
+3
-2
No files found.
app/controllers/profiles/preferences_controller.rb
View file @
04bb82c8
...
...
@@ -6,7 +6,9 @@ class Profiles::PreferencesController < Profiles::ApplicationController
def
update
begin
if
@user
.
update_attributes
(
preferences_params
)
result
=
Users
::
UpdateService
.
new
(
current_user
,
user
,
preferences_params
).
execute
if
result
[
:status
]
==
:success
flash
[
:notice
]
=
'Preferences saved.'
else
flash
[
:alert
]
=
'Failed to save preferences.'
...
...
spec/controllers/profiles/preferences_controller_spec.rb
View file @
04bb82c8
...
...
@@ -43,7 +43,8 @@ describe Profiles::PreferencesController do
dashboard:
'stars'
}.
with_indifferent_access
expect
(
user
).
to
receive
(
:update_attributes
).
with
(
prefs
)
expect
(
user
).
to
receive
(
:assign_attributes
).
with
(
prefs
)
expect
(
user
).
to
receive
(
:save
)
go
params:
prefs
end
...
...
@@ -51,7 +52,7 @@ describe Profiles::PreferencesController do
context
'on failed update'
do
it
'sets the flash'
do
expect
(
user
).
to
receive
(
:
update_attributes
).
and_return
(
false
)
expect
(
user
).
to
receive
(
:
save
).
and_return
(
false
)
go
...
...
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