FIX: The text to users who signed up when approval was required was
misleading.
This commit is contained in:
parent
cc9b040502
commit
c9eb809dad
|
@ -245,7 +245,7 @@ class UsersController < ApplicationController
|
|||
activation.finish
|
||||
|
||||
# save user email in session, to show on account-created page
|
||||
session["user_created_email"] = user.email
|
||||
session["user_created_message"] = activation.message
|
||||
|
||||
render json: {
|
||||
success: true,
|
||||
|
@ -364,6 +364,7 @@ class UsersController < ApplicationController
|
|||
end
|
||||
|
||||
def account_created
|
||||
@message = session['user_created_message']
|
||||
expires_now
|
||||
render layout: 'no_js'
|
||||
end
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
<div id='simple-container'>
|
||||
<% if session["user_created_email"] %>
|
||||
<span style="font-size: 16px; line-height: 24px;"><%= t('login.activate_email', email: session["user_created_email"]).html_safe %></span>
|
||||
<% end %>
|
||||
<span style="font-size: 16px; line-height: 24px;"><%= @message.html_safe %></span>
|
||||
</div>
|
||||
|
|
|
@ -357,8 +357,8 @@ describe UsersController do
|
|||
|
||||
expect(JSON.parse(response.body)['active']).to be_falsey
|
||||
|
||||
# should save user_created_email in session
|
||||
session["user_created_email"].should == @user.email
|
||||
# should save user_created_message in session
|
||||
session["user_created_message"].should be_present
|
||||
end
|
||||
|
||||
context "and 'must approve users' site setting is enabled" do
|
||||
|
@ -393,8 +393,8 @@ describe UsersController do
|
|||
User.any_instance.expects(:enqueue_welcome_message).with('welcome_user')
|
||||
post_user
|
||||
|
||||
# should save user_created_email in session
|
||||
session["user_created_email"].should == @user.email
|
||||
# should save user_created_message in session
|
||||
session["user_created_message"].should be_present
|
||||
end
|
||||
|
||||
it "shows the 'active' message" do
|
||||
|
@ -479,7 +479,7 @@ describe UsersController do
|
|||
json["success"].should == true
|
||||
|
||||
# should not change the session
|
||||
session["user_created_email"].should be_blank
|
||||
session["user_created_message"].should be_blank
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -523,7 +523,7 @@ describe UsersController do
|
|||
json["success"].should_not == true
|
||||
|
||||
# should not change the session
|
||||
session["user_created_email"].should be_blank
|
||||
session["user_created_message"].should be_blank
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue