Sha256: f6e9766918bdcccd6d56456abc3e1c580b3f3815006c2876b41083c557ed0806

Contents?: true

Size: 871 Bytes

Versions: 5

Compression:

Stored size: 871 Bytes

Contents

require 'spec_helper'

describe 'Confirming an email', type: :feature do
  let(:exhibit) { FactoryGirl.create(:default_exhibit) }
  let(:contact_email) { Spotlight::ContactEmail.create!(email: 'justin@example.com', exhibit: exhibit) }
  let(:raw_token) { contact_email.instance_variable_get(:@raw_confirmation_token) }

  it 'resends confirmation instructions' do
    visit spotlight.new_contact_email_confirmation_url(confirmation_token: contact_email.confirmation_token)
    expect(page).to have_content('Resend confirmation instructions')
    within '#new_contact_email' do
      fill_in 'Email', with: contact_email.email
      click_button 'Resend confirmation instructions'
    end
  end

  it 'confirms email' do
    visit spotlight.contact_email_confirmation_url(confirmation_token: raw_token)
    expect(page).to have_content('successfully confirmed')
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
blacklight-spotlight-0.7.2 spec/features/confirm_email_spec.rb
blacklight-spotlight-0.7.1 spec/features/confirm_email_spec.rb
blacklight-spotlight-0.7.0 spec/features/confirm_email_spec.rb
blacklight-spotlight-0.6.0 spec/features/confirm_email_spec.rb
blacklight-spotlight-0.5.0 spec/features/confirm_email_spec.rb