Sha256: b605320a857459d11b6b76bfe1223a06ba50c3c4778e30cfe54dfe0ef0eaad3d

Contents?: true

Size: 984 Bytes

Versions: 10

Compression:

Stored size: 984 Bytes

Contents

require File.expand_path("spec_helper", File.dirname(__FILE__))

describe 'Rodauth change_password_notify feature' do
  it "should email when using change password" do
    rodauth do
      enable :login, :logout, :change_password_notify
      change_password_requires_password? false
    end
    roda do |r|
      r.rodauth
      r.root{view :content=>""}
    end

    login
    page.current_path.must_equal '/'

    visit '/change-password'
    fill_in 'New Password', :with=>'0123456'
    fill_in 'Confirm Password', :with=>'0123456'
    click_button 'Change Password'
    page.find('#notice_flash').text.must_equal "Your password has been changed"

    page.current_path.must_equal '/'
    msgs = Mail::TestMailer.deliveries
    msgs.length.must_equal 1
    msgs.first.to.first.must_equal 'foo@example.com'
    msgs.first.body.to_s.must_equal <<EMAIL
Someone (hopefully you) has changed the password for the account
associated to this email address.
EMAIL
    msgs.clear
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
rodauth-1.22.0 spec/change_password_notify_spec.rb
rodauth-1.21.0 spec/change_password_notify_spec.rb
rodauth-1.20.0 spec/change_password_notify_spec.rb
rodauth-1.19.1 spec/change_password_notify_spec.rb
rodauth-1.19.0 spec/change_password_notify_spec.rb
rodauth-1.18.0 spec/change_password_notify_spec.rb
rodauth-1.17.0 spec/change_password_notify_spec.rb
rodauth-1.16.0 spec/change_password_notify_spec.rb
rodauth-1.15.0 spec/change_password_notify_spec.rb
rodauth-1.14.0 spec/change_password_notify_spec.rb