transactional db support for capybara tests!

This commit is contained in:
James Mason 2018-11-16 11:57:51 -08:00
parent 1b9a12746d
commit a9e8498abe
7 changed files with 43 additions and 30 deletions

View file

@ -111,21 +111,19 @@ feature Event do
scenario 'signed_in user submits a valid proposal', feature: true, js: true do
sign_in participant_without_bio
expected_count = Event.count + 1
visit conference_program_proposals_path(conference.short_title)
click_link 'New Proposal'
fill_in 'event_title', with: 'Example Proposal'
select('Example Event Type', from: 'event[event_type_id]')
fill_in 'event_abstract', with: 'Lorem ipsum abstract'
click_link 'description_link'
fill_in 'event_description', with: 'Lorem ipsum description'
click_button 'Create Proposal'
page.find('#flash')
expect(page).to have_content 'Proposal was successfully submitted.'
TransactionalCapybara::AjaxHelpers.wait_for_ajax(page)
expect(current_path).to eq(conference_program_proposals_path(conference.short_title))
expect(Event.count).to eq(expected_count)
end