Sha256: 3802e784b62665355c233dbdbb6dd53b177bebda0eea76e5c4a81d753f9aafc0

Contents?: true

Size: 894 Bytes

Versions: 7

Compression:

Stored size: 894 Bytes

Contents

require 'rails_helper'

RSpec.describe 'Nyauth::ConfirmationRequests' do
  let!(:user) { create(:user) }

  feature 'confirmation' do
    background do
      visit nyauth.new_confirmation_request_path
    end

    scenario 'request & confirm' do
      fill_in('confirmation_request_email', with: user.email)
      click_button(I18n.t('nav.nyauth.common.send'))

      open_email(user.email)
      current_email.click_link('confirm')

      expect(page).to have_content('confirmed')
      user.reload
      expect(user).to be_confirmed
    end

    scenario 'request expired' do
      fill_in('confirmation_request_email', with: user.email)
      click_button(I18n.t('nav.nyauth.common.send'))

      Timecop.freeze(Time.current + 3.hours) do
        open_email(user.email)
        current_email.click_link('confirm')

        expect(page).to have_content('expired')
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
nyauth-0.7.2 spec/featrues/nyauth/confirmation_requests_spec.rb
nyauth-0.7.1 spec/featrues/nyauth/confirmation_requests_spec.rb
nyauth-0.7.0 spec/featrues/nyauth/confirmation_requests_spec.rb
nyauth-0.6.2 spec/featrues/nyauth/confirmation_requests_spec.rb
nyauth-0.6.1 spec/featrues/nyauth/confirmation_requests_spec.rb
nyauth-0.6.0 spec/featrues/nyauth/confirmation_requests_spec.rb
nyauth-0.5.0 spec/featrues/nyauth/confirmation_requests_spec.rb