Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
D
diaspora
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
diasporg
diaspora
Commits
42f790fa
Commit
42f790fa
authored
Jan 11, 2014
by
Jonne Haß
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4666 from jaywink/signup-form-error-redirect
Instead of redirect on signup form validation, render new
parents
76083197
35ece9d6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
4 deletions
+12
-4
Changelog.md
Changelog.md
+1
-0
app/controllers/registrations_controller.rb
app/controllers/registrations_controller.rb
+2
-2
spec/controllers/registrations_controller_spec.rb
spec/controllers/registrations_controller_spec.rb
+9
-2
No files found.
Changelog.md
View file @
42f790fa
...
...
@@ -64,6 +64,7 @@ For more details see https://wiki.diasporafoundation.org/Updating
*
Change "Show n more comments"-link, fix
[
#3119
](
https://github.com/diaspora/diaspora/issues/3119
)
*
Specify Firefox version for Travis-CI
[
#4623
](
https://github.com/diaspora/diaspora/pull/4623
)
*
Remove location when publisher is cleared by user
*
On signup form errors, don't empty previous values by user, fix
[
#4663
](
https://github.com/diaspora/diaspora/issues/4663
)
## Features
*
Add oEmbed content to the mobile view
[
#4343
](
https://github.com/diaspora/diaspora/pull/4353
)
...
...
app/controllers/registrations_controller.rb
View file @
42f790fa
...
...
@@ -6,7 +6,7 @@ class RegistrationsController < Devise::RegistrationsController
before_filter
:check_registrations_open_or_vaild_invite!
,
:check_valid_invite!
layout
->
(
c
)
{
request
.
format
==
:mobile
?
"application"
:
"with_header"
},
:only
=>
[
:new
]
before_filter
->
{
@css_framework
=
:bootstrap
},
only:
[
:new
]
before_filter
->
{
@css_framework
=
:bootstrap
},
only:
[
:new
,
:create
]
def
create
@user
=
User
.
build
(
user_params
)
...
...
@@ -22,7 +22,7 @@ class RegistrationsController < Devise::RegistrationsController
flash
[
:error
]
=
@user
.
errors
.
full_messages
.
join
(
" - "
)
Rails
.
logger
.
info
(
"event=registration status=failure errors='
#{
@user
.
errors
.
full_messages
.
join
(
', '
)
}
'"
)
re
direct_to
:back
re
nder
:action
=>
'new'
,
:layout
=>
'with_header'
end
end
...
...
spec/controllers/registrations_controller_spec.rb
View file @
42f790fa
...
...
@@ -53,6 +53,8 @@ describe RegistrationsController do
end
describe
"#create"
do
render_views
context
"with valid parameters"
do
before
do
AppConfig
.
settings
.
enable_registrations
=
true
...
...
@@ -107,9 +109,14 @@ describe RegistrationsController do
flash
[
:error
].
should_not
be_blank
end
it
"re
directs back
"
do
it
"re
nders new
"
do
get
:create
,
@invalid_params
response
.
should
be_redirect
expect
(
response
).
to
render_template
(
"registrations/new"
)
end
it
"keeps invalid params in form"
do
get
:create
,
@invalid_params
expect
(
response
.
body
).
to
match
/jdoe@example.com/m
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