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
1dd995a7
Commit
1dd995a7
authored
Aug 12, 2014
by
Jan-Willem van der Meer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move tests as well, remove public namespace from controller
parent
a881e4cc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
21 deletions
+19
-21
app/controllers/unsubscribes_controller.rb
app/controllers/unsubscribes_controller.rb
+18
-20
spec/controllers/unsubscribes_controller_spec.rb
spec/controllers/unsubscribes_controller_spec.rb
+1
-1
No files found.
app/controllers/unsubscribes_controller.rb
View file @
1dd995a7
module
Public
class
UnsubscribesController
<
ApplicationController
skip_before_filter
:authenticate_user!
,
:reject_blocked
,
:set_current_user_for_observers
,
:add_abilities
layout
'public_users'
class
UnsubscribesController
<
ApplicationController
skip_before_filter
:authenticate_user!
,
:reject_blocked
,
:set_current_user_for_observers
,
:add_abilities
layout
'public_users'
def
show
@user
=
get_user
end
def
show
@user
=
get_user
end
def
create
@user
=
get_user
@user
.
admin_unsubscribe!
if
@user
redirect_to
new_user_session_path
,
notice:
'You have been unsubscribed'
end
def
create
@user
=
get_user
@user
.
admin_unsubscribe!
if
@user
redirect_to
new_user_session_path
,
notice:
'You have been unsubscribed'
end
protected
def
get_user
@email
=
"
#{
params
[
:email
]
}
.
#{
params
[
:format
]
}
"
User
.
where
(
email:
@email
).
first
end
protected
def
get_user
@email
=
"
#{
params
[
:email
]
}
.
#{
params
[
:format
]
}
"
User
.
where
(
email:
@email
).
first
end
end
\ No newline at end of file
end
spec/controllers/
public/
unsubscribes_controller_spec.rb
→
spec/controllers/unsubscribes_controller_spec.rb
View file @
1dd995a7
require
'spec_helper'
describe
Public
::
UnsubscribesController
do
describe
UnsubscribesController
do
let!
(
:user
)
{
create
:user
,
email:
'me@example.com'
}
describe
"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