diff --git a/spec/factories/event_types.rb b/spec/factories/event_types.rb index a9710ea3..9624b406 100644 --- a/spec/factories/event_types.rb +++ b/spec/factories/event_types.rb @@ -6,6 +6,7 @@ FactoryBot.define do factory :event_type do title { 'Example Event Type' } length { 30 } + description { 'This event type is an example.' } minimum_abstract_length { 0 } maximum_abstract_length { 500 } color { '#ffffff' } diff --git a/spec/features/proposals_spec.rb b/spec/features/proposals_spec.rb index 8ce84577..59282898 100644 --- a/spec/features/proposals_spec.rb +++ b/spec/features/proposals_spec.rb @@ -68,7 +68,7 @@ feature Event do @event.accept!(@options) end - scenario 'not signed_in user submits proposal' do + scenario 'not signed_in user submits proposal', js: true do expected_count_event = Event.count + 1 expected_count_user = User.count + 1 @@ -80,7 +80,9 @@ feature Event do fill_in 'user_password_confirmation', with: 'testuserpassword' end fill_in 'event_title', with: 'Example Proposal' + expect(page).to have_selector '.in', text: 'Presentation in lecture format' select('Example Event Type', from: 'event[event_type_id]') + expect(page).to have_selector '.in', text: 'This event type is an example.' fill_in 'event_abstract', with: 'Lorem ipsum abstract' click_button 'Create Proposal' @@ -102,7 +104,7 @@ feature Event do expect(page).to have_content 'Proposal Information' end - scenario 'update a proposal' do + scenario 'update a proposal', js: true do conference = create(:conference) create(:cfp, program: conference.program) proposal = create(:event, program: conference.program) @@ -113,6 +115,7 @@ feature Event do fill_in 'event_subtitle', with: 'My event subtitle' select('Easy', from: 'event[difficulty_level_id]') + expect(page).to have_selector '.in', text: 'Events are understandable for everyone without knowledge of the topic.' click_button 'Update Proposal' page.find('#flash') @@ -125,11 +128,10 @@ feature Event do visit conference_program_proposals_path(conference.short_title) click_link 'New Proposal' - expect(page).to have_selector(".in[id='#{find_field('event[event_type_id]').value}-help']") # End of animation fill_in 'event_title', with: 'Example Proposal' select('Example Event Type', from: 'event[event_type_id]') - expect(page).to have_selector(".in[id='#{find_field('event[event_type_id]').value}-help']") # End of animation + expect(page).to have_selector '.in', text: 'This event type is an example.' fill_in 'event_abstract', with: 'Lorem ipsum abstract' expect(page).to have_text('You have used 3 words')