ateam-merb-auth-old 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -40,8 +40,10 @@ module MerbAuth
|
|
40
40
|
if logged_in? && !current_ma_user.activated?
|
41
41
|
Merb.logger.info "Activated #{current_ma_user}"
|
42
42
|
current_ma_user.activate
|
43
|
+
redirect url(:merb_auth_activated)
|
44
|
+
else
|
45
|
+
redirect url(:merb_auth_activated, :fail => 'true')
|
43
46
|
end
|
44
|
-
redirect url(:merb_auth_activated)
|
45
47
|
end
|
46
48
|
|
47
49
|
private
|
@@ -90,6 +90,13 @@ describe MA::Users do
|
|
90
90
|
User.authenticate('aaron@example.com', 'test').should_not be_nil
|
91
91
|
end
|
92
92
|
|
93
|
+
it 'should fail activation because of invalid or not existing code' do
|
94
|
+
controller = create_user(:email => "aaron@example.com", :password => "test", :password_confirmation => "test")
|
95
|
+
@user = controller.assigns(:user)
|
96
|
+
controller = get "/merb-auth/users/activate/#{@user.activation_code}__"
|
97
|
+
controller.headers['Location'].should == "/merb-auth/activated?fail=true"
|
98
|
+
end
|
99
|
+
|
93
100
|
it "should log the user in automatically on creation if :use_activation is false" do
|
94
101
|
MA[:use_activation] = false
|
95
102
|
dispatch_to(MA::Users, :create, :user => {:email => "aaron@example.com", :password => "test", :password_confirmation => "test"}) do |c|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ateam-merb-auth-old
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ateam
|
@@ -9,7 +9,7 @@ autorequire: name
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-02-05 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|