update devise

This commit is contained in:
Jonne Haß 2012-09-06 18:31:27 +02:00
parent 2de0213d6f
commit 142e38e78b
10 changed files with 101 additions and 83 deletions

View file

@ -16,7 +16,7 @@ gem 'rack-cors', '~> 0.2.4', :require => 'rack/cors'
# authentication # authentication
gem 'devise', '1.5.3' gem 'devise', '2.1.2'
gem 'remotipart', '~> 1.0' gem 'remotipart', '~> 1.0'

View file

@ -149,10 +149,11 @@ GEM
debugger-linecache (1.1.2) debugger-linecache (1.1.2)
debugger-ruby_core_source (>= 1.1.1) debugger-ruby_core_source (>= 1.1.1)
debugger-ruby_core_source (1.1.3) debugger-ruby_core_source (1.1.3)
devise (1.5.3) devise (2.1.2)
bcrypt-ruby (~> 3.0) bcrypt-ruby (~> 3.0)
orm_adapter (~> 0.0.3) orm_adapter (~> 0.1)
warden (~> 1.1) railties (~> 3.1)
warden (~> 1.2.1)
diff-lcs (1.1.3) diff-lcs (1.1.3)
erubis (2.7.0) erubis (2.7.0)
eventmachine (0.12.10) eventmachine (0.12.10)
@ -311,7 +312,7 @@ GEM
omniauth-twitter (0.0.11) omniauth-twitter (0.0.11)
multi_json (~> 1.3) multi_json (~> 1.3)
omniauth-oauth (~> 1.0) omniauth-oauth (~> 1.0)
orm_adapter (0.0.7) orm_adapter (0.4.0)
pg (0.14.1) pg (0.14.1)
polyglot (0.3.3) polyglot (0.3.3)
rack (1.4.1) rack (1.4.1)
@ -450,7 +451,7 @@ GEM
raindrops (~> 0.7) raindrops (~> 0.7)
vegas (0.1.11) vegas (0.1.11)
rack (>= 1.0.0) rack (>= 1.0.0)
warden (1.2.0) warden (1.2.1)
rack (>= 1.0) rack (>= 1.0)
webmock (1.8.7) webmock (1.8.7)
addressable (>= 2.2.7) addressable (>= 2.2.7)
@ -482,7 +483,7 @@ DEPENDENCIES
cucumber-rails (= 1.3.0) cucumber-rails (= 1.3.0)
database_cleaner (= 0.8) database_cleaner (= 0.8)
debugger debugger
devise (= 1.5.3) devise (= 2.1.2)
factory_girl_rails (= 1.7.0) factory_girl_rails (= 1.7.0)
faraday faraday
faraday_middleware faraday_middleware

View file

@ -185,7 +185,7 @@ class User < ActiveRecord::Base
end end
def send_reset_password_instructions def send_reset_password_instructions
generate_reset_password_token! if should_generate_token? generate_reset_password_token! if should_generate_reset_token?
Resque.enqueue(Jobs::ResetPassword, self.id) Resque.enqueue(Jobs::ResetPassword, self.id)
end end

View file

@ -31,7 +31,7 @@ module Devise
module Strategies module Strategies
class TokenAuthenticatable < Authenticatable class TokenAuthenticatable < Authenticatable
private private
def valid_request? def valid_params_request?
params[:controller] == "activity_streams/photos" && params[:action] == "create" params[:controller] == "activity_streams/photos" && params[:action] == "create"
end end
end end

View file

@ -56,15 +56,11 @@ Devise.setup do |config|
# using other encryptors, it sets how many times you want the password re-encrypted. # using other encryptors, it sets how many times you want the password re-encrypted.
config.stretches = Rails.env.test? ? 1 : 10 config.stretches = Rails.env.test? ? 1 : 10
# Define which will be the encryption algorithm. Devise also supports encryptors
# from others authentication tools as :clearance_sha1, :authlogic_sha512 (then
# you should set stretches above to 20 for default behavior) and :restful_authentication_sha1
# (then you should set stretches to 10, and copy REST_AUTH_SITE_KEY to pepper)
config.encryptor = :bcrypt
# Setup a pepper to generate the encrypted password. # Setup a pepper to generate the encrypted password.
config.pepper = "065eb8798b181ff0ea2c5c16aee0ff8b70e04e2ee6bd6e08b49da46924223e39127d5335e466207d42bf2a045c12be5f90e92012a4f05f7fc6d9f3c875f4c95b" config.pepper = "065eb8798b181ff0ea2c5c16aee0ff8b70e04e2ee6bd6e08b49da46924223e39127d5335e466207d42bf2a045c12be5f90e92012a4f05f7fc6d9f3c875f4c95b"
config.reset_password_within = 2.days
# ==> Configuration for :invitable # ==> Configuration for :invitable
# Time interval where the invitation token is valid (default: 0). # Time interval where the invitation token is valid (default: 0).
# If invite_for is 0 or nil, the invitation will never expire. # If invite_for is 0 or nil, the invitation will never expire.
@ -77,7 +73,7 @@ Devise.setup do |config|
# You can use this to let your user access some features of your application # You can use this to let your user access some features of your application
# without confirming the account, but blocking it after a certain period # without confirming the account, but blocking it after a certain period
# (ie 2 days). # (ie 2 days).
# config.confirm_within = 2.days # config.allow_unconfirmed_access_for = 2.days
# ==> Configuration for :rememberable # ==> Configuration for :rememberable
# The time the user will be remembered without asking for credentials again. # The time the user will be remembered without asking for credentials again.
@ -118,7 +114,7 @@ Devise.setup do |config|
# ==> Configuration for :token_authenticatable # ==> Configuration for :token_authenticatable
# Defines name of the authentication token params key # Defines name of the authentication token params key
config.token_authentication_key = :auth_token config.token_authentication_key = :auth_token
config.stateless_token = true config.skip_session_storage << :token_auth
# ==> Scopes configuration # ==> Scopes configuration
# Turn scoped views on. Before rendering "sessions/new", it will first check for # Turn scoped views on. Before rendering "sessions/new", it will first check for

View file

@ -151,16 +151,21 @@ class CreateSchema < ActiveRecord::Migration
t.boolean :getting_started, :default => true t.boolean :getting_started, :default => true
t.boolean :disable_mail, :default => false t.boolean :disable_mail, :default => false
t.string :language t.string :language
t.string :email
t.database_authenticatable t.string :email, :null => false, :default => ""
t.string :encrypted_password, :null => false, :default => ""
t.string :invitation_token, :limit => 60 t.string :invitation_token, :limit => 60
t.datetime :invitation_sent_at t.datetime :invitation_sent_at
t.recoverable t.string :reset_password_token
t.rememberable t.datetime :reset_password_sent_at
t.trackable t.datetime :remember_created_at
t.integer :sign_in_count, :default => 0
t.datetime :current_sign_in_at
t.datetime :last_sign_in_at
t.string :current_sign_in_ip
t.string :last_sign_in_ip
t.timestamps t.timestamps
end end

View file

@ -164,11 +164,17 @@ class CreateImportTables < ActiveRecord::Migration
t.boolean :getting_started t.boolean :getting_started
t.boolean :disable_mail t.boolean :disable_mail
t.string :language t.string :language
t.string :email t.string :email, :null => false, :default => ""
t.database_authenticatable t.string :encrypted_password, :null => false, :default => ""
t.recoverable t.string :reset_password_token
t.rememberable t.datetime :reset_password_sent_at
t.trackable t.datetime :remember_created_at
t.integer :sign_in_count, :default => 0
t.datetime :current_sign_in_at
t.datetime :last_sign_in_at
t.string :current_sign_in_ip
t.string :last_sign_in_ip
t.timestamps t.timestamps
t.string :mongo_id t.string :mongo_id

View file

@ -0,0 +1,11 @@
class UpdateDevise < ActiveRecord::Migration
def up
remove_column :users, :remember_token
add_column :users, :reset_password_sent_at, :datetime
end
def down
add_column :users, :remember_token, :string
remove_column :users, :reset_password_sent_at
end
end

View file

@ -20,8 +20,8 @@ ActiveRecord::Schema.define(:version => 20120909053122) do
create_table "aspect_memberships", :force => true do |t| create_table "aspect_memberships", :force => true do |t|
t.integer "aspect_id", :null => false t.integer "aspect_id", :null => false
t.integer "contact_id", :null => false t.integer "contact_id", :null => false
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
end end
add_index "aspect_memberships", ["aspect_id", "contact_id"], :name => "index_aspect_memberships_on_aspect_id_and_contact_id", :unique => true add_index "aspect_memberships", ["aspect_id", "contact_id"], :name => "index_aspect_memberships_on_aspect_id_and_contact_id", :unique => true
@ -31,8 +31,8 @@ ActiveRecord::Schema.define(:version => 20120909053122) do
create_table "aspect_visibilities", :force => true do |t| create_table "aspect_visibilities", :force => true do |t|
t.integer "shareable_id", :null => false t.integer "shareable_id", :null => false
t.integer "aspect_id", :null => false t.integer "aspect_id", :null => false
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
t.string "shareable_type", :default => "Post", :null => false t.string "shareable_type", :default => "Post", :null => false
end end
@ -43,8 +43,8 @@ ActiveRecord::Schema.define(:version => 20120909053122) do
create_table "aspects", :force => true do |t| create_table "aspects", :force => true do |t|
t.string "name", :null => false t.string "name", :null => false
t.integer "user_id", :null => false t.integer "user_id", :null => false
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
t.boolean "contacts_visible", :default => true, :null => false t.boolean "contacts_visible", :default => true, :null => false
t.integer "order_id" t.integer "order_id"
end end
@ -64,8 +64,8 @@ ActiveRecord::Schema.define(:version => 20120909053122) do
t.string "guid", :null => false t.string "guid", :null => false
t.text "author_signature" t.text "author_signature"
t.text "parent_author_signature" t.text "parent_author_signature"
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
t.integer "likes_count", :default => 0, :null => false t.integer "likes_count", :default => 0, :null => false
t.string "commentable_type", :limit => 60, :default => "Post", :null => false t.string "commentable_type", :limit => 60, :default => "Post", :null => false
end end
@ -77,8 +77,8 @@ ActiveRecord::Schema.define(:version => 20120909053122) do
create_table "contacts", :force => true do |t| create_table "contacts", :force => true do |t|
t.integer "user_id", :null => false t.integer "user_id", :null => false
t.integer "person_id", :null => false t.integer "person_id", :null => false
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
t.boolean "sharing", :default => false, :null => false t.boolean "sharing", :default => false, :null => false
t.boolean "receiving", :default => false, :null => false t.boolean "receiving", :default => false, :null => false
end end
@ -90,8 +90,8 @@ ActiveRecord::Schema.define(:version => 20120909053122) do
t.integer "conversation_id", :null => false t.integer "conversation_id", :null => false
t.integer "person_id", :null => false t.integer "person_id", :null => false
t.integer "unread", :default => 0, :null => false t.integer "unread", :default => 0, :null => false
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
end end
add_index "conversation_visibilities", ["conversation_id", "person_id"], :name => "index_conversation_visibilities_usefully", :unique => true add_index "conversation_visibilities", ["conversation_id", "person_id"], :name => "index_conversation_visibilities_usefully", :unique => true
@ -102,8 +102,8 @@ ActiveRecord::Schema.define(:version => 20120909053122) do
t.string "subject" t.string "subject"
t.string "guid", :null => false t.string "guid", :null => false
t.integer "author_id", :null => false t.integer "author_id", :null => false
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
end end
add_index "conversations", ["author_id"], :name => "conversations_author_id_fk" add_index "conversations", ["author_id"], :name => "conversations_author_id_fk"
@ -112,8 +112,8 @@ ActiveRecord::Schema.define(:version => 20120909053122) do
t.string "token" t.string "token"
t.integer "user_id" t.integer "user_id"
t.integer "count" t.integer "count"
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
end end
create_table "invitations", :force => true do |t| create_table "invitations", :force => true do |t|
@ -121,8 +121,8 @@ ActiveRecord::Schema.define(:version => 20120909053122) do
t.integer "sender_id" t.integer "sender_id"
t.integer "recipient_id" t.integer "recipient_id"
t.integer "aspect_id" t.integer "aspect_id"
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
t.string "service" t.string "service"
t.string "identifier" t.string "identifier"
t.boolean "admin", :default => false t.boolean "admin", :default => false
@ -140,8 +140,8 @@ ActiveRecord::Schema.define(:version => 20120909053122) do
t.string "guid" t.string "guid"
t.text "author_signature" t.text "author_signature"
t.text "parent_author_signature" t.text "parent_author_signature"
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
t.string "target_type", :limit => 60, :null => false t.string "target_type", :limit => 60, :null => false
end end
@ -164,8 +164,8 @@ ActiveRecord::Schema.define(:version => 20120909053122) do
t.integer "author_id", :null => false t.integer "author_id", :null => false
t.string "guid", :null => false t.string "guid", :null => false
t.text "text", :null => false t.text "text", :null => false
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
t.text "author_signature" t.text "author_signature"
t.text "parent_author_signature" t.text "parent_author_signature"
end end
@ -176,8 +176,8 @@ ActiveRecord::Schema.define(:version => 20120909053122) do
create_table "notification_actors", :force => true do |t| create_table "notification_actors", :force => true do |t|
t.integer "notification_id" t.integer "notification_id"
t.integer "person_id" t.integer "person_id"
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
end end
add_index "notification_actors", ["notification_id", "person_id"], :name => "index_notification_actors_on_notification_id_and_person_id", :unique => true add_index "notification_actors", ["notification_id", "person_id"], :name => "index_notification_actors_on_notification_id_and_person_id", :unique => true
@ -189,8 +189,8 @@ ActiveRecord::Schema.define(:version => 20120909053122) do
t.integer "target_id" t.integer "target_id"
t.integer "recipient_id", :null => false t.integer "recipient_id", :null => false
t.boolean "unread", :default => true, :null => false t.boolean "unread", :default => true, :null => false
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
t.string "type" t.string "type"
end end
@ -212,8 +212,8 @@ ActiveRecord::Schema.define(:version => 20120909053122) do
t.integer "author_id" t.integer "author_id"
t.text "author_signature" t.text "author_signature"
t.text "parent_author_signature" t.text "parent_author_signature"
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
end end
add_index "participations", ["guid"], :name => "index_participations_on_guid" add_index "participations", ["guid"], :name => "index_participations_on_guid"
@ -225,8 +225,8 @@ ActiveRecord::Schema.define(:version => 20120909053122) do
t.string "diaspora_handle", :null => false t.string "diaspora_handle", :null => false
t.text "serialized_public_key", :null => false t.text "serialized_public_key", :null => false
t.integer "owner_id" t.integer "owner_id"
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
t.boolean "closed_account", :default => false t.boolean "closed_account", :default => false
t.integer "fetch_status", :default => 0 t.integer "fetch_status", :default => 0
end end
@ -261,8 +261,8 @@ ActiveRecord::Schema.define(:version => 20120909053122) do
create_table "pods", :force => true do |t| create_table "pods", :force => true do |t|
t.string "host" t.string "host"
t.boolean "ssl" t.boolean "ssl"
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
end end
create_table "posts", :force => true do |t| create_table "posts", :force => true do |t|
@ -277,8 +277,8 @@ ActiveRecord::Schema.define(:version => 20120909053122) do
t.string "remote_photo_name" t.string "remote_photo_name"
t.string "random_string" t.string "random_string"
t.string "processed_image" t.string "processed_image"
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
t.string "unprocessed_image" t.string "unprocessed_image"
t.string "object_url" t.string "object_url"
t.string "image_url" t.string "image_url"
@ -319,8 +319,8 @@ ActiveRecord::Schema.define(:version => 20120909053122) do
t.text "bio" t.text "bio"
t.boolean "searchable", :default => true, :null => false t.boolean "searchable", :default => true, :null => false
t.integer "person_id", :null => false t.integer "person_id", :null => false
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
t.string "location" t.string "location"
t.string "full_name", :limit => 70 t.string "full_name", :limit => 70
t.boolean "nsfw", :default => false t.boolean "nsfw", :default => false
@ -337,8 +337,8 @@ ActiveRecord::Schema.define(:version => 20120909053122) do
t.string "table" t.string "table"
t.integer "month", :limit => 2 t.integer "month", :limit => 2
t.integer "year", :limit => 8 t.integer "year", :limit => 8
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
end end
add_index "rails_admin_histories", ["item", "table", "month", "year"], :name => "index_rails_admin_histories" add_index "rails_admin_histories", ["item", "table", "month", "year"], :name => "index_rails_admin_histories"
@ -346,8 +346,8 @@ ActiveRecord::Schema.define(:version => 20120909053122) do
create_table "roles", :force => true do |t| create_table "roles", :force => true do |t|
t.integer "person_id" t.integer "person_id"
t.string "name" t.string "name"
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
end end
create_table "services", :force => true do |t| create_table "services", :force => true do |t|
@ -357,8 +357,8 @@ ActiveRecord::Schema.define(:version => 20120909053122) do
t.string "access_token" t.string "access_token"
t.string "access_secret" t.string "access_secret"
t.string "nickname" t.string "nickname"
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
end end
add_index "services", ["type", "uid"], :name => "index_services_on_type_and_uid" add_index "services", ["type", "uid"], :name => "index_services_on_type_and_uid"
@ -366,8 +366,8 @@ ActiveRecord::Schema.define(:version => 20120909053122) do
create_table "share_visibilities", :force => true do |t| create_table "share_visibilities", :force => true do |t|
t.integer "shareable_id", :null => false t.integer "shareable_id", :null => false
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
t.boolean "hidden", :default => false, :null => false t.boolean "hidden", :default => false, :null => false
t.integer "contact_id", :null => false t.integer "contact_id", :null => false
t.string "shareable_type", :limit => 60, :default => "Post", :null => false t.string "shareable_type", :limit => 60, :default => "Post", :null => false
@ -381,8 +381,8 @@ ActiveRecord::Schema.define(:version => 20120909053122) do
create_table "tag_followings", :force => true do |t| create_table "tag_followings", :force => true do |t|
t.integer "tag_id", :null => false t.integer "tag_id", :null => false
t.integer "user_id", :null => false t.integer "user_id", :null => false
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
end end
add_index "tag_followings", ["tag_id", "user_id"], :name => "index_tag_followings_on_tag_id_and_user_id", :unique => true add_index "tag_followings", ["tag_id", "user_id"], :name => "index_tag_followings_on_tag_id_and_user_id", :unique => true
@ -413,8 +413,8 @@ ActiveRecord::Schema.define(:version => 20120909053122) do
create_table "user_preferences", :force => true do |t| create_table "user_preferences", :force => true do |t|
t.string "email_type" t.string "email_type"
t.integer "user_id" t.integer "user_id"
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
end end
create_table "users", :force => true do |t| create_table "users", :force => true do |t|
@ -428,15 +428,14 @@ ActiveRecord::Schema.define(:version => 20120909053122) do
t.string "invitation_token", :limit => 60 t.string "invitation_token", :limit => 60
t.datetime "invitation_sent_at" t.datetime "invitation_sent_at"
t.string "reset_password_token" t.string "reset_password_token"
t.string "remember_token"
t.datetime "remember_created_at" t.datetime "remember_created_at"
t.integer "sign_in_count", :default => 0 t.integer "sign_in_count", :default => 0
t.datetime "current_sign_in_at" t.datetime "current_sign_in_at"
t.datetime "last_sign_in_at" t.datetime "last_sign_in_at"
t.string "current_sign_in_ip" t.string "current_sign_in_ip"
t.string "last_sign_in_ip" t.string "last_sign_in_ip"
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
t.string "invitation_service", :limit => 127 t.string "invitation_service", :limit => 127
t.string "invitation_identifier", :limit => 127 t.string "invitation_identifier", :limit => 127
t.integer "invitation_limit" t.integer "invitation_limit"
@ -450,13 +449,13 @@ ActiveRecord::Schema.define(:version => 20120909053122) do
t.boolean "auto_follow_back", :default => false t.boolean "auto_follow_back", :default => false
t.integer "auto_follow_back_aspect_id" t.integer "auto_follow_back_aspect_id"
t.text "hidden_shareables" t.text "hidden_shareables"
t.datetime "reset_password_sent_at"
end end
add_index "users", ["authentication_token"], :name => "index_users_on_authentication_token", :unique => true add_index "users", ["authentication_token"], :name => "index_users_on_authentication_token", :unique => true
add_index "users", ["email"], :name => "index_users_on_email" add_index "users", ["email"], :name => "index_users_on_email"
add_index "users", ["invitation_service", "invitation_identifier"], :name => "index_users_on_invitation_service_and_invitation_identifier", :unique => true add_index "users", ["invitation_service", "invitation_identifier"], :name => "index_users_on_invitation_service_and_invitation_identifier", :unique => true
add_index "users", ["invitation_token"], :name => "index_users_on_invitation_token" add_index "users", ["invitation_token"], :name => "index_users_on_invitation_token"
add_index "users", ["remember_token"], :name => "index_users_on_remember_token", :unique => true
add_index "users", ["username"], :name => "index_users_on_username", :unique => true add_index "users", ["username"], :name => "index_users_on_username", :unique => true
add_foreign_key "aspect_memberships", "aspects", :name => "aspect_memberships_aspect_id_fk", :dependent => :delete add_foreign_key "aspect_memberships", "aspects", :name => "aspect_memberships_aspect_id_fk", :dependent => :delete

View file

@ -803,14 +803,14 @@ describe User do
describe "#send_reset_password_instructions" do describe "#send_reset_password_instructions" do
it "generates a reset password token if it's supposed to" do it "generates a reset password token if it's supposed to" do
user = User.new user = User.new
user.stub!(:should_generate_token?).and_return(true) user.stub!(:should_generate_reset_token?).and_return(true)
user.should_receive(:generate_reset_password_token) user.should_receive(:generate_reset_password_token)
user.send_reset_password_instructions user.send_reset_password_instructions
end end
it "does not generate a reset password token if it's not supposed to" do it "does not generate a reset password token if it's not supposed to" do
user = User.new user = User.new
user.stub!(:should_generate_token?).and_return(false) user.stub!(:should_generate_reset_token?).and_return(false)
user.should_not_receive(:generate_reset_password_token) user.should_not_receive(:generate_reset_password_token)
user.send_reset_password_instructions user.send_reset_password_instructions
end end
@ -872,8 +872,8 @@ describe User do
language language
invitation_token invitation_token
invitation_sent_at invitation_sent_at
reset_password_sent_at
reset_password_token reset_password_token
remember_token
remember_created_at remember_created_at
sign_in_count sign_in_count
current_sign_in_at current_sign_in_at