Sha256: 2e5f73d81f26e43ab428acae5d7cf18e78dfd9c6b9115bc512331095ec7835e1

Contents?: true

Size: 736 Bytes

Versions: 3

Compression:

Stored size: 736 Bytes

Contents

require 'spec_helper'

feature 'Visitor resets password' do
  scenario 'with valid email' do
    user = user_with_reset_password

    page_should_display_change_password_message
    reset_notification_should_be_sent_to user
  end

  scenario 'with non-user account' do
    reset_password_for 'unknown.email@example.com'

    page_should_display_change_password_message
    mailer_should_have_no_deliveries
  end

  private

  def reset_notification_should_be_sent_to(user)
    user.confirmation_token.should_not be_blank
    mailer_should_have_delivery user.email, 'password', user.confirmation_token
  end

  def page_should_display_change_password_message
    page.should have_content I18n.t('passwords.create.description')
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
clearance-1.0.0.rc7 lib/generators/clearance/specs/templates/integration/clearance/visitor_resets_password_spec.rb
clearance-1.0.0.rc6 lib/generators/clearance/specs/templates/integration/clearance/visitor_resets_password_spec.rb
clearance-1.0.0.rc4 lib/generators/clearance/specs/templates/integration/clearance/visitor_resets_password_spec.rb