Commit 7db6046a7ea5c392352cdbbf689d9486d47f1ef0
Exists in
master
and in
29 other branches
Merge branch 'remote_user_fix' into 'master'
Remote user fix Small fix in Remote user plugin: - When the remote user plugin creates a user, it doesn't activate it. See merge request !353
Showing
2 changed files
with
4 additions
and
0 deletions
Show diff stats
plugins/remote_user/lib/remote_user_plugin.rb
... | ... | @@ -24,6 +24,7 @@ class RemoteUserPlugin < Noosfero::Plugin |
24 | 24 | self.current_user = User.find_by_login(remote_user) |
25 | 25 | unless self.current_user |
26 | 26 | self.current_user = User.create!(:login => remote_user, :email => (remote_user + '@remote.user'), :password => ('pw4'+remote_user), :password_confirmation => ('pw4'+remote_user)) |
27 | + self.current_user.activate | |
27 | 28 | end |
28 | 29 | self.current_user.save! |
29 | 30 | else |
... | ... | @@ -34,6 +35,7 @@ class RemoteUserPlugin < Noosfero::Plugin |
34 | 35 | self.current_user = User.find_by_login(remote_user) |
35 | 36 | unless self.current_user |
36 | 37 | self.current_user = User.create!(:login => remote_user, :email => (remote_user + '@remote.user'), :password => ('pw4'+remote_user), :password_confirmation => ('pw4'+remote_user)) |
38 | + self.current_user.activate | |
37 | 39 | end |
38 | 40 | self.current_user.save! |
39 | 41 | end | ... | ... |
plugins/remote_user/test/functional/remote_user_plugin_test.rb
... | ... | @@ -52,6 +52,7 @@ class AccountControllerTest < ActionController::TestCase |
52 | 52 | |
53 | 53 | assert_equal 1, User.count |
54 | 54 | assert_equal "testuser", User.last.login |
55 | + assert_equal true, User.last.activated? | |
55 | 56 | assert_equal User.last.id, session[:user] |
56 | 57 | end |
57 | 58 | |
... | ... | @@ -67,6 +68,7 @@ class AccountControllerTest < ActionController::TestCase |
67 | 68 | |
68 | 69 | assert_equal 2, User.count |
69 | 70 | assert_equal "another_user", User.last.login |
71 | + assert_equal true, User.last.activated? | |
70 | 72 | assert_equal User.last.id, session[:user] |
71 | 73 | end |
72 | 74 | end | ... | ... |