Sha256: 830babf32dd116f36f8e08d704bd1d8f7bce71a392869b8a0cdb73c6bf39cd1c

Contents?: true

Size: 1.1 KB

Versions: 22

Compression:

Stored size: 1.1 KB

Contents

describe 'Report a Problem', type: :feature do
  let!(:exhibit) { FactoryGirl.create(:exhibit) }
  it 'does not have a header link' do
    visit root_path
    expect(page).to_not have_content 'Feedback'
  end

  describe 'when emails are setup' do
    before do
      exhibit.contact_emails_attributes = [{ 'email' => 'test@example.com' }, { 'email' => 'test2@example.com' }]
      exhibit.save!
      exhibit.contact_emails.first.tap do |e|
        if e.respond_to? :confirm
          e.confirm
        else
          e.confirm!
        end
      end
    end

    it 'accepts a problem report', js: true do
      visit spotlight.exhibit_solr_document_path(exhibit, id: 'dq287tq6352')
      click_on 'Feedback'
      expect(find('#contact_form_current_url', visible: false).value).to end_with spotlight.exhibit_solr_document_path(exhibit, id: 'dq287tq6352')
      fill_in 'Name', with: 'Some Body'
      fill_in 'Email', with: 'test@example.com'
      fill_in 'Message', with: 'This is my problem report'

      expect do
        click_on 'Send'
      end.to change { ActionMailer::Base.deliveries.count }.by(1)
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
blacklight-spotlight-0.30.0 spec/features/report_a_problem_spec.rb
blacklight-spotlight-0.29.1 spec/features/report_a_problem_spec.rb
blacklight-spotlight-0.29.0 spec/features/report_a_problem_spec.rb
blacklight-spotlight-0.28.3 spec/features/report_a_problem_spec.rb
blacklight-spotlight-0.28.2 spec/features/report_a_problem_spec.rb
blacklight-spotlight-0.28.1 spec/features/report_a_problem_spec.rb
blacklight-spotlight-0.28.0 spec/features/report_a_problem_spec.rb
blacklight-spotlight-0.27.0 spec/features/report_a_problem_spec.rb
blacklight-spotlight-0.26.1 spec/features/report_a_problem_spec.rb
blacklight-spotlight-0.26.0 spec/features/report_a_problem_spec.rb
blacklight-spotlight-0.25.0 spec/features/report_a_problem_spec.rb
blacklight-spotlight-0.24.0 spec/features/report_a_problem_spec.rb
blacklight-spotlight-0.23.0 spec/features/report_a_problem_spec.rb
blacklight-spotlight-0.22.0 spec/features/report_a_problem_spec.rb
blacklight-spotlight-0.21.0 spec/features/report_a_problem_spec.rb
blacklight-spotlight-0.20.3 spec/features/report_a_problem_spec.rb
blacklight-spotlight-0.20.2 spec/features/report_a_problem_spec.rb
blacklight-spotlight-0.20.1 spec/features/report_a_problem_spec.rb
blacklight-spotlight-0.20.0 spec/features/report_a_problem_spec.rb
blacklight-spotlight-0.19.2 spec/features/report_a_problem_spec.rb