sorcery 0.7.0 → 0.7.4
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.
- data/Gemfile +1 -3
- data/Gemfile.lock +47 -57
- data/README.rdoc +19 -57
- data/Rakefile +27 -1
- data/VERSION +1 -1
- data/lib/generators/sorcery/USAGE +22 -0
- data/lib/generators/sorcery/install_generator.rb +72 -0
- data/lib/{sorcery/initializers → generators/sorcery/templates}/initializer.rb +4 -4
- data/lib/generators/sorcery/templates/migration/activity_logging.rb +17 -0
- data/lib/generators/sorcery/templates/migration/brute_force_protection.rb +11 -0
- data/lib/generators/{sorcery_migration/templates → sorcery/templates/migration}/core.rb +2 -2
- data/lib/generators/{sorcery_migration/templates → sorcery/templates/migration}/external.rb +1 -1
- data/lib/generators/sorcery/templates/migration/remember_me.rb +15 -0
- data/lib/generators/sorcery/templates/migration/reset_password.rb +17 -0
- data/lib/generators/sorcery/templates/migration/user_activation.rb +17 -0
- data/lib/sorcery/controller/submodules/activity_logging.rb +8 -11
- data/lib/sorcery/controller/submodules/brute_force_protection.rb +2 -2
- data/lib/sorcery/controller/submodules/external/protocols/oauth2.rb +23 -8
- data/lib/sorcery/controller/submodules/external/providers/twitter.rb +1 -1
- data/lib/sorcery/controller/submodules/remember_me.rb +16 -14
- data/lib/sorcery/controller/submodules/session_timeout.rb +3 -3
- data/lib/sorcery/controller.rb +40 -39
- data/lib/sorcery/model/adapters/mongo_mapper.rb +49 -0
- data/lib/sorcery/model/adapters/mongoid.rb +3 -1
- data/lib/sorcery/model/submodules/brute_force_protection.rb +14 -6
- data/lib/sorcery/model/submodules/remember_me.rb +9 -2
- data/lib/sorcery/model/submodules/reset_password.rb +12 -2
- data/lib/sorcery/model/submodules/user_activation.rb +13 -1
- data/lib/sorcery/model/temporary_token.rb +4 -2
- data/lib/sorcery/model.rb +21 -4
- data/lib/sorcery.rb +5 -7
- data/sorcery.gemspec +83 -216
- data/spec/Gemfile +1 -1
- data/spec/Gemfile.lock +20 -17
- data/spec/README.md +6 -1
- data/spec/rails3/Gemfile +2 -2
- data/spec/rails3/Gemfile.lock +36 -51
- data/spec/rails3/spec/controller_activity_logging_spec.rb +6 -6
- data/spec/rails3/spec/controller_brute_force_protection_spec.rb +2 -2
- data/spec/rails3/spec/controller_oauth2_spec.rb +5 -3
- data/spec/rails3/spec/controller_session_timeout_spec.rb +4 -4
- data/spec/rails3/spec/spec_helper.rb +1 -3
- data/spec/rails3_mongo_mapper/.gitignore +4 -0
- data/spec/rails3_mongo_mapper/.rspec +1 -0
- data/spec/{sinatra_modular → rails3_mongo_mapper}/Gemfile +5 -5
- data/spec/rails3_mongo_mapper/Gemfile.lock +158 -0
- data/spec/{sinatra → rails3_mongo_mapper}/Rakefile +3 -3
- data/spec/rails3_mongo_mapper/app/controllers/application_controller.rb +108 -0
- data/spec/rails3_mongo_mapper/app/helpers/application_helper.rb +2 -0
- data/spec/rails3_mongo_mapper/app/models/authentication.rb +6 -0
- data/spec/rails3_mongo_mapper/app/models/user.rb +5 -0
- data/spec/rails3_mongo_mapper/app/views/layouts/application.html.erb +14 -0
- data/spec/rails3_mongo_mapper/app/views/sorcery_mailer/activation_email.html.erb +17 -0
- data/spec/rails3_mongo_mapper/app/views/sorcery_mailer/activation_email.text.erb +9 -0
- data/spec/rails3_mongo_mapper/app/views/sorcery_mailer/activation_success_email.html.erb +17 -0
- data/spec/rails3_mongo_mapper/app/views/sorcery_mailer/activation_success_email.text.erb +9 -0
- data/spec/rails3_mongo_mapper/app/views/sorcery_mailer/reset_password_email.html.erb +16 -0
- data/spec/rails3_mongo_mapper/app/views/sorcery_mailer/reset_password_email.text.erb +8 -0
- data/spec/rails3_mongo_mapper/config/application.rb +51 -0
- data/spec/rails3_mongo_mapper/config/boot.rb +13 -0
- data/spec/rails3_mongo_mapper/config/environment.rb +5 -0
- data/spec/rails3_mongo_mapper/config/environments/development.rb +30 -0
- data/spec/rails3_mongo_mapper/config/environments/in_memory.rb +0 -0
- data/spec/rails3_mongo_mapper/config/environments/production.rb +49 -0
- data/spec/rails3_mongo_mapper/config/environments/test.rb +35 -0
- data/spec/rails3_mongo_mapper/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/rails3_mongo_mapper/config/initializers/inflections.rb +10 -0
- data/spec/rails3_mongo_mapper/config/initializers/mime_types.rb +5 -0
- data/spec/rails3_mongo_mapper/config/initializers/mongo.rb +2 -0
- data/spec/rails3_mongo_mapper/config/initializers/secret_token.rb +7 -0
- data/spec/rails3_mongo_mapper/config/initializers/session_store.rb +8 -0
- data/spec/rails3_mongo_mapper/config/locales/en.yml +5 -0
- data/spec/rails3_mongo_mapper/config/routes.rb +59 -0
- data/spec/rails3_mongo_mapper/config.ru +4 -0
- data/spec/rails3_mongo_mapper/db/schema.rb +23 -0
- data/spec/rails3_mongo_mapper/db/seeds.rb +7 -0
- data/spec/rails3_mongo_mapper/lib/tasks/.gitkeep +0 -0
- data/spec/rails3_mongo_mapper/public/404.html +26 -0
- data/spec/rails3_mongo_mapper/public/422.html +26 -0
- data/spec/rails3_mongo_mapper/public/500.html +26 -0
- data/spec/rails3_mongo_mapper/public/favicon.ico +0 -0
- data/spec/rails3_mongo_mapper/public/images/rails.png +0 -0
- data/spec/rails3_mongo_mapper/public/javascripts/application.js +2 -0
- data/spec/rails3_mongo_mapper/public/javascripts/controls.js +965 -0
- data/spec/rails3_mongo_mapper/public/javascripts/dragdrop.js +974 -0
- data/spec/rails3_mongo_mapper/public/javascripts/effects.js +1123 -0
- data/spec/rails3_mongo_mapper/public/javascripts/prototype.js +6001 -0
- data/spec/rails3_mongo_mapper/public/javascripts/rails.js +175 -0
- data/spec/rails3_mongo_mapper/public/robots.txt +5 -0
- data/spec/rails3_mongo_mapper/public/stylesheets/.gitkeep +0 -0
- data/spec/rails3_mongo_mapper/script/rails +6 -0
- data/spec/{sinatra → rails3_mongo_mapper}/spec/controller_spec.rb +45 -42
- data/spec/rails3_mongo_mapper/spec/spec_helper.orig.rb +27 -0
- data/spec/rails3_mongo_mapper/spec/spec_helper.rb +55 -0
- data/spec/rails3_mongo_mapper/spec/user_activation_spec.rb +9 -0
- data/spec/rails3_mongo_mapper/spec/user_activity_logging_spec.rb +8 -0
- data/spec/rails3_mongo_mapper/spec/user_brute_force_protection_spec.rb +8 -0
- data/spec/rails3_mongo_mapper/spec/user_oauth_spec.rb +8 -0
- data/spec/rails3_mongo_mapper/spec/user_remember_me_spec.rb +8 -0
- data/spec/rails3_mongo_mapper/spec/user_reset_password_spec.rb +8 -0
- data/spec/rails3_mongo_mapper/spec/user_spec.rb +37 -0
- data/spec/rails3_mongo_mapper/vendor/plugins/.gitkeep +0 -0
- data/spec/rails3_mongoid/Gemfile +1 -1
- data/spec/rails3_mongoid/Gemfile.lock +38 -36
- data/spec/rails3_mongoid/script/rails +0 -0
- data/spec/rails3_mongoid/spec/controller_activity_logging_spec.rb +98 -0
- data/spec/rails3_mongoid/spec/controller_spec.rb +11 -0
- data/spec/rails3_mongoid/spec/user_spec.rb +1 -0
- data/spec/shared_examples/user_activation_shared_examples.rb +1 -1
- data/spec/shared_examples/user_remember_me_shared_examples.rb +1 -1
- data/spec/shared_examples/user_reset_password_shared_examples.rb +2 -2
- data/spec/shared_examples/user_shared_examples.rb +29 -1
- metadata +105 -251
- data/lib/generators/sorcery_migration/sorcery_migration_generator.rb +0 -24
- data/lib/generators/sorcery_migration/templates/activity_logging.rb +0 -17
- data/lib/generators/sorcery_migration/templates/brute_force_protection.rb +0 -11
- data/lib/generators/sorcery_migration/templates/remember_me.rb +0 -15
- data/lib/generators/sorcery_migration/templates/reset_password.rb +0 -17
- data/lib/generators/sorcery_migration/templates/user_activation.rb +0 -17
- data/lib/sorcery/controller/adapters/sinatra.rb +0 -115
- data/lib/sorcery/sinatra.rb +0 -4
- data/lib/sorcery/test_helpers/internal/sinatra.rb +0 -74
- data/lib/sorcery/test_helpers/internal/sinatra_modular.rb +0 -74
- data/lib/sorcery/test_helpers/sinatra.rb +0 -88
- data/spec/rails3/Rakefile.unused +0 -7
- data/spec/sinatra/Gemfile +0 -15
- data/spec/sinatra/Gemfile.lock +0 -115
- data/spec/sinatra/authentication.rb +0 -3
- data/spec/sinatra/db/migrate/activation/20101224223622_add_activation_to_users.rb +0 -17
- data/spec/sinatra/db/migrate/activity_logging/20101224223624_add_activity_logging_to_users.rb +0 -17
- data/spec/sinatra/db/migrate/brute_force_protection/20101224223626_add_brute_force_protection_to_users.rb +0 -11
- data/spec/sinatra/db/migrate/core/20101224223620_create_users.rb +0 -16
- data/spec/sinatra/db/migrate/external/20101224223628_create_authentications.rb +0 -14
- data/spec/sinatra/db/migrate/remember_me/20101224223623_add_remember_me_token_to_users.rb +0 -15
- data/spec/sinatra/db/migrate/reset_password/20101224223622_add_reset_password_to_users.rb +0 -13
- data/spec/sinatra/filters.rb +0 -27
- data/spec/sinatra/modular.rb +0 -157
- data/spec/sinatra/myapp.rb +0 -133
- data/spec/sinatra/spec/controller_activity_logging_spec.rb +0 -85
- data/spec/sinatra/spec/controller_brute_force_protection_spec.rb +0 -70
- data/spec/sinatra/spec/controller_http_basic_auth_spec.rb +0 -53
- data/spec/sinatra/spec/controller_oauth2_spec.rb +0 -96
- data/spec/sinatra/spec/controller_oauth_spec.rb +0 -100
- data/spec/sinatra/spec/controller_remember_me_spec.rb +0 -64
- data/spec/sinatra/spec/controller_session_timeout_spec.rb +0 -57
- data/spec/sinatra/spec/spec_helper.rb +0 -45
- data/spec/sinatra/user.rb +0 -6
- data/spec/sinatra/views/test_login.erb +0 -4
- data/spec/sinatra_modular/Gemfile.lock +0 -115
- data/spec/sinatra_modular/Rakefile +0 -11
- data/spec/sinatra_modular/authentication.rb +0 -3
- data/spec/sinatra_modular/db/migrate/activation/20101224223622_add_activation_to_users.rb +0 -17
- data/spec/sinatra_modular/db/migrate/activity_logging/20101224223624_add_activity_logging_to_users.rb +0 -17
- data/spec/sinatra_modular/db/migrate/brute_force_protection/20101224223626_add_brute_force_protection_to_users.rb +0 -11
- data/spec/sinatra_modular/db/migrate/core/20101224223620_create_users.rb +0 -16
- data/spec/sinatra_modular/db/migrate/external/20101224223628_create_authentications.rb +0 -14
- data/spec/sinatra_modular/db/migrate/remember_me/20101224223623_add_remember_me_token_to_users.rb +0 -15
- data/spec/sinatra_modular/db/migrate/reset_password/20101224223622_add_reset_password_to_users.rb +0 -13
- data/spec/sinatra_modular/filters.rb +0 -27
- data/spec/sinatra_modular/modular.rb +0 -157
- data/spec/sinatra_modular/myapp.rb +0 -133
- data/spec/sinatra_modular/sorcery_mailer.rb +0 -25
- data/spec/sinatra_modular/spec_modular/controller_activity_logging_spec.rb +0 -85
- data/spec/sinatra_modular/spec_modular/controller_brute_force_protection_spec.rb +0 -70
- data/spec/sinatra_modular/spec_modular/controller_http_basic_auth_spec.rb +0 -53
- data/spec/sinatra_modular/spec_modular/controller_oauth2_spec.rb +0 -96
- data/spec/sinatra_modular/spec_modular/controller_oauth_spec.rb +0 -100
- data/spec/sinatra_modular/spec_modular/controller_remember_me_spec.rb +0 -64
- data/spec/sinatra_modular/spec_modular/controller_session_timeout_spec.rb +0 -57
- data/spec/sinatra_modular/spec_modular/controller_spec.rb +0 -116
- data/spec/sinatra_modular/spec_modular/spec.opts +0 -2
- data/spec/sinatra_modular/spec_modular/spec_helper.rb +0 -51
- data/spec/sinatra_modular/user.rb +0 -6
- data/spec/sinatra_modular/views/test_login.erb +0 -4
- /data/spec/{sinatra → rails3_mongo_mapper/app/mailers}/sorcery_mailer.rb +0 -0
- /data/spec/{sinatra → rails3_mongo_mapper}/spec/spec.opts +0 -0
|
File without changes
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
|
2
|
+
|
|
3
|
+
describe ApplicationController do
|
|
4
|
+
|
|
5
|
+
# ----------------- ACTIVITY LOGGING -----------------------
|
|
6
|
+
describe ApplicationController, "with activity logging features" do
|
|
7
|
+
before(:all) do
|
|
8
|
+
sorcery_reload!([:activity_logging])
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
before(:each) do
|
|
12
|
+
create_new_user
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
after(:each) do
|
|
16
|
+
User.delete_all
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
specify { subject.should respond_to(:current_users) }
|
|
20
|
+
|
|
21
|
+
it "'current_users' should be empty when no users are logged in" do
|
|
22
|
+
subject.current_users.size.should == 0
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
it "should log login time on login" do
|
|
26
|
+
now = Time.now.in_time_zone
|
|
27
|
+
login_user
|
|
28
|
+
@user.last_login_at.should_not be_nil
|
|
29
|
+
@user.last_login_at.to_s(:db).should >= now.to_s(:db)
|
|
30
|
+
@user.last_login_at.to_s(:db).should <= (now+2).to_s(:db)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
it "should log logout time on logout" do
|
|
34
|
+
login_user
|
|
35
|
+
now = Time.now.in_time_zone
|
|
36
|
+
logout_user
|
|
37
|
+
User.first.last_logout_at.should_not be_nil
|
|
38
|
+
User.first.last_logout_at.to_s(:db).should >= now.to_s(:db)
|
|
39
|
+
User.first.last_logout_at.to_s(:db).should <= (now+2).to_s(:db)
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
it "should log last activity time when logged in" do
|
|
43
|
+
login_user
|
|
44
|
+
now = Time.now.in_time_zone
|
|
45
|
+
get :some_action
|
|
46
|
+
User.first.last_activity_at.to_s(:db).should >= now.to_s(:db)
|
|
47
|
+
User.first.last_activity_at.to_s(:db).should <= (now+2).to_s(:db)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
it "'current_users' should hold the user object when 1 user is logged in" do
|
|
51
|
+
login_user
|
|
52
|
+
get :some_action
|
|
53
|
+
subject.current_users.size.should == 1
|
|
54
|
+
subject.current_users[0].should == @user
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
it "'current_users' should show all current_users, whether they have logged out before or not." do
|
|
58
|
+
user1 = create_new_user({:username => 'gizmo1', :email => "bla1@bla.com", :password => 'secret1'})
|
|
59
|
+
login_user(user1)
|
|
60
|
+
get :some_action
|
|
61
|
+
clear_user_without_logout
|
|
62
|
+
user2 = create_new_user({:username => 'gizmo2', :email => "bla2@bla.com", :password => 'secret2'})
|
|
63
|
+
login_user(user2)
|
|
64
|
+
get :some_action
|
|
65
|
+
clear_user_without_logout
|
|
66
|
+
user3 = create_new_user({:username => 'gizmo3', :email => "bla3@bla.com", :password => 'secret3'})
|
|
67
|
+
login_user(user3)
|
|
68
|
+
get :some_action
|
|
69
|
+
subject.current_users.size.should == 3
|
|
70
|
+
subject.current_users[0].should == user1
|
|
71
|
+
subject.current_users[1].should == user2
|
|
72
|
+
subject.current_users[2].should == user3
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
it "should not register login time if configured so" do
|
|
76
|
+
sorcery_controller_property_set(:register_login_time, false)
|
|
77
|
+
now = Time.now.in_time_zone
|
|
78
|
+
login_user
|
|
79
|
+
@user.last_login_at.should be_nil
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
it "should not register logout time if configured so" do
|
|
83
|
+
sorcery_controller_property_set(:register_logout_time, false)
|
|
84
|
+
now = Time.now.in_time_zone
|
|
85
|
+
login_user
|
|
86
|
+
logout_user
|
|
87
|
+
@user.last_logout_at.should be_nil
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
it "should not register last activity time if configured so" do
|
|
91
|
+
sorcery_controller_property_set(:register_last_activity_time, false)
|
|
92
|
+
now = Time.now.in_time_zone
|
|
93
|
+
login_user
|
|
94
|
+
get :some_action
|
|
95
|
+
@user.last_activity_at.should be_nil
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
end
|
|
@@ -94,6 +94,17 @@ describe ApplicationController do
|
|
|
94
94
|
end
|
|
95
95
|
|
|
96
96
|
specify { should respond_to(:require_login) }
|
|
97
|
+
|
|
98
|
+
it "should call the configured 'not_authenticated_action' when session[:user_id] isn't found" do
|
|
99
|
+
# If someone passes in a bogus user_id than no big deal, but if a user is deleted
|
|
100
|
+
# and there is still an active session out there for him this causes problems.
|
|
101
|
+
user = User.create(:email => 'test@example.com', :password => 'password')
|
|
102
|
+
session[:user_id] = user.id
|
|
103
|
+
user.destroy
|
|
104
|
+
sorcery_controller_property_set(:not_authenticated_action, :test_not_authenticated_action)
|
|
105
|
+
get :test_logout
|
|
106
|
+
response.body.should == "test_not_authenticated_action"
|
|
107
|
+
end
|
|
97
108
|
|
|
98
109
|
it "should call the configured 'not_authenticated_action' when authenticate before_filter fails" do
|
|
99
110
|
session[:user_id] = nil
|
|
@@ -155,7 +155,7 @@ shared_examples_for "rails_3_activation_model" do
|
|
|
155
155
|
it "load_from_activation_token should NOT return user when token is found and expired" do
|
|
156
156
|
sorcery_model_property_set(:activation_token_expiration_period, 0.1)
|
|
157
157
|
create_new_user
|
|
158
|
-
Timecop.travel(Time.now+0.5)
|
|
158
|
+
Timecop.travel(Time.now.in_time_zone+0.5)
|
|
159
159
|
User.load_from_activation_token(@user.activation_token).should == nil
|
|
160
160
|
end
|
|
161
161
|
|
|
@@ -34,7 +34,7 @@ shared_examples_for "rails_3_remember_me_model" do
|
|
|
34
34
|
it "should set an expiration based on 'remember_me_for' attribute" do
|
|
35
35
|
sorcery_model_property_set(:remember_me_for, 2 * 60 * 60 * 24)
|
|
36
36
|
@user.remember_me!
|
|
37
|
-
@user.remember_me_token_expires_at.utc.to_s.should == (Time.now + 2 * 60 * 60 * 24).utc.to_s
|
|
37
|
+
@user.remember_me_token_expires_at.utc.to_s.should == (Time.now.in_time_zone + 2 * 60 * 60 * 24).utc.to_s
|
|
38
38
|
end
|
|
39
39
|
|
|
40
40
|
it "should delete the token and expiration on 'forget_me!'" do
|
|
@@ -93,7 +93,7 @@ shared_examples_for "rails_3_reset_password_model" do
|
|
|
93
93
|
create_new_user
|
|
94
94
|
sorcery_model_property_set(:reset_password_expiration_period, 0.1)
|
|
95
95
|
@user.deliver_reset_password_instructions!
|
|
96
|
-
Timecop.travel(Time.now+0.5)
|
|
96
|
+
Timecop.travel(Time.now.in_time_zone+0.5)
|
|
97
97
|
User.load_from_reset_password_token(@user.reset_password_token).should == nil
|
|
98
98
|
end
|
|
99
99
|
|
|
@@ -157,7 +157,7 @@ shared_examples_for "rails_3_reset_password_model" do
|
|
|
157
157
|
old_size = ActionMailer::Base.deliveries.size
|
|
158
158
|
@user.deliver_reset_password_instructions!
|
|
159
159
|
ActionMailer::Base.deliveries.size.should == old_size + 1
|
|
160
|
-
Timecop.travel(Time.now+0.5)
|
|
160
|
+
Timecop.travel(Time.now.in_time_zone+0.5)
|
|
161
161
|
@user.deliver_reset_password_instructions!
|
|
162
162
|
ActionMailer::Base.deliveries.size.should == old_size + 2
|
|
163
163
|
end
|
|
@@ -56,7 +56,6 @@ shared_examples_for "rails_3_core_model" do
|
|
|
56
56
|
sorcery_model_property_set(:stretches, stretches)
|
|
57
57
|
User.sorcery_config.stretches.should equal(stretches)
|
|
58
58
|
end
|
|
59
|
-
|
|
60
59
|
end
|
|
61
60
|
|
|
62
61
|
# ----------------- PLUGIN ACTIVATED -----------------------
|
|
@@ -268,6 +267,35 @@ shared_examples_for "rails_3_core_model" do
|
|
|
268
267
|
end
|
|
269
268
|
|
|
270
269
|
end
|
|
270
|
+
|
|
271
|
+
describe User, "ORM adapter" do
|
|
272
|
+
before(:all) do
|
|
273
|
+
sorcery_reload!()
|
|
274
|
+
User.delete_all
|
|
275
|
+
end
|
|
276
|
+
|
|
277
|
+
before(:each) do
|
|
278
|
+
create_new_user
|
|
279
|
+
end
|
|
280
|
+
|
|
281
|
+
after(:each) do
|
|
282
|
+
User.delete_all
|
|
283
|
+
User.sorcery_config.reset!
|
|
284
|
+
end
|
|
285
|
+
|
|
286
|
+
it "find_by_username should work as expected" do
|
|
287
|
+
User.find_by_username("gizmo").should == @user
|
|
288
|
+
end
|
|
289
|
+
|
|
290
|
+
it "find_by_username should work as expected with multiple username attributes" do
|
|
291
|
+
sorcery_model_property_set(:username_attribute_names, [:username, :email])
|
|
292
|
+
User.find_by_username("gizmo").should == @user
|
|
293
|
+
end
|
|
294
|
+
|
|
295
|
+
it "find_by_email should work as expected" do
|
|
296
|
+
User.find_by_email("bla@bla.com").should == @user
|
|
297
|
+
end
|
|
298
|
+
end
|
|
271
299
|
end
|
|
272
300
|
|
|
273
301
|
shared_examples_for "external_user" do
|