2018-05-07 16:47:29 -07:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
2014-05-12 13:19:09 +02:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
|
|
feature Event do
|
2015-10-25 13:29:02 +02:00
|
|
|
let!(:conference) { create(:conference) }
|
2016-03-17 14:54:35 +05:30
|
|
|
let!(:registration_period) { create(:registration_period, conference: conference, start_date: Date.current) }
|
2015-10-25 13:29:02 +02:00
|
|
|
let!(:cfp) { create(:cfp, program_id: conference.program.id) }
|
2019-03-13 10:31:42 +01:00
|
|
|
let!(:organizer) { create(:organizer, resource: conference) }
|
2014-08-28 15:21:05 +02:00
|
|
|
let!(:participant) { create(:user) }
|
|
|
|
|
let!(:participant_without_bio) { create(:user, biography: '') }
|
2014-05-12 13:19:09 +02:00
|
|
|
|
2014-08-28 15:21:05 +02:00
|
|
|
before(:each) do
|
|
|
|
|
@options = {}
|
|
|
|
|
@options[:send_mail] = 'false'
|
2015-10-25 13:29:02 +02:00
|
|
|
@event = create(:event, program: conference.program, title: 'Example Proposal')
|
2016-05-19 11:47:41 +02:00
|
|
|
@event.event_users.create(user: participant, event_role: 'submitter')
|
|
|
|
|
@event.event_users.create(user: participant, event_role: 'speaker')
|
2014-08-28 15:21:05 +02:00
|
|
|
end
|
2014-05-12 13:19:09 +02:00
|
|
|
|
2014-08-28 15:21:05 +02:00
|
|
|
after(:each) do
|
|
|
|
|
sign_out
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
context 'as an conference organizer' do
|
|
|
|
|
before(:each) do
|
|
|
|
|
sign_in organizer
|
|
|
|
|
end
|
|
|
|
|
|
2021-02-25 11:15:23 -08:00
|
|
|
scenario 'can preview a proposal if it is public', feature: true, js: true do
|
|
|
|
|
visit admin_conference_program_event_path(conference.short_title, @event)
|
|
|
|
|
expect(page).to have_selector(:link_or_button, 'Preview')
|
|
|
|
|
click_link 'Preview'
|
|
|
|
|
expect(current_path).to eq(conference_program_proposal_path(conference.short_title, @event.id))
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
scenario 'cannot preview a proposal if it is not public', feature: true, js: true do
|
|
|
|
|
event = create(:event, program: conference.program, title: 'Example Proposal')
|
|
|
|
|
event.public = false
|
|
|
|
|
event.save!
|
|
|
|
|
visit admin_conference_program_event_path(conference.short_title, event)
|
|
|
|
|
expect(page).to_not have_selector(:link_or_button, 'Preview')
|
|
|
|
|
end
|
|
|
|
|
|
2014-08-28 15:21:05 +02:00
|
|
|
scenario 'rejects a proposal', feature: true, js: true do
|
2015-10-25 13:29:02 +02:00
|
|
|
visit admin_conference_program_events_path(conference.short_title)
|
2017-07-20 17:30:27 +05:30
|
|
|
expect(page).to have_content 'Example Proposal'
|
2014-05-12 13:19:09 +02:00
|
|
|
|
2018-02-13 16:33:11 -08:00
|
|
|
click_on 'New'
|
|
|
|
|
click_link 'Reject'
|
2017-07-19 17:47:02 +05:30
|
|
|
expect(page).to have_content 'Event rejected!'
|
2014-08-28 15:21:05 +02:00
|
|
|
@event.reload
|
|
|
|
|
expect(@event.state).to eq('rejected')
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
scenario 'accepts a proposal', feature: true, js: true do
|
2015-10-25 13:29:02 +02:00
|
|
|
visit admin_conference_program_events_path(conference.short_title)
|
2017-07-20 17:30:27 +05:30
|
|
|
expect(page).to have_content 'Example Proposal'
|
2014-08-28 15:21:05 +02:00
|
|
|
|
2018-02-13 16:33:11 -08:00
|
|
|
click_on 'New'
|
|
|
|
|
click_link 'Accept'
|
2017-07-19 17:47:02 +05:30
|
|
|
expect(page).to have_content 'Event accepted!'
|
2017-07-20 17:30:27 +05:30
|
|
|
expect(page).to have_content 'Unconfirmed'
|
2014-08-28 15:21:05 +02:00
|
|
|
@event.reload
|
|
|
|
|
expect(@event.state).to eq('unconfirmed')
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
scenario 'restarts review of a proposal', feature: true, js: true do
|
|
|
|
|
@event.reject!(@options)
|
2015-10-25 13:29:02 +02:00
|
|
|
visit admin_conference_program_events_path(conference.short_title)
|
2017-07-20 17:30:27 +05:30
|
|
|
expect(page).to have_content 'Example Proposal'
|
2014-08-28 15:21:05 +02:00
|
|
|
|
2018-02-13 16:33:11 -08:00
|
|
|
click_on 'Rejected'
|
|
|
|
|
click_link 'Start review'
|
2017-07-19 17:47:02 +05:30
|
|
|
expect(page).to have_content 'Review started!'
|
2014-08-28 15:21:05 +02:00
|
|
|
@event.reload
|
|
|
|
|
expect(@event.state).to eq('new')
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
context 'as a participant' do
|
|
|
|
|
before(:each) do
|
|
|
|
|
@event.accept!(@options)
|
|
|
|
|
end
|
|
|
|
|
|
2015-04-16 18:34:41 +03:00
|
|
|
scenario 'not signed_in user submits proposal' do
|
|
|
|
|
expected_count_event = Event.count + 1
|
|
|
|
|
expected_count_user = User.count + 1
|
|
|
|
|
|
2015-10-25 13:29:02 +02:00
|
|
|
visit new_conference_program_proposal_path(conference.short_title)
|
2015-04-16 18:34:41 +03:00
|
|
|
|
|
|
|
|
fill_in 'user_username', with: 'Test User'
|
|
|
|
|
fill_in 'user_email', with: 'testuser@osem.io'
|
|
|
|
|
fill_in 'password_inline', with: 'testuserpassword'
|
|
|
|
|
fill_in 'user_password_confirmation', with: 'testuserpassword'
|
|
|
|
|
|
|
|
|
|
fill_in 'event_title', with: 'Example Proposal'
|
|
|
|
|
select('Example Event Type', from: 'event[event_type_id]')
|
|
|
|
|
fill_in 'event_abstract', with: 'Lorem ipsum abstract'
|
2021-02-17 17:27:41 -08:00
|
|
|
fill_in 'event_submission_text', with: 'Lorem ipsum submission'
|
2015-04-16 18:34:41 +03:00
|
|
|
|
2021-02-23 21:42:42 -08:00
|
|
|
click_button 'Submit Proposal'
|
2018-10-25 16:16:56 -07:00
|
|
|
page.find('#flash')
|
2017-07-20 17:30:27 +05:30
|
|
|
expect(page).to have_content 'Proposal was successfully submitted.'
|
2015-04-16 18:34:41 +03:00
|
|
|
|
|
|
|
|
expect(Event.count).to eq(expected_count_event)
|
|
|
|
|
expect(User.count).to eq(expected_count_user)
|
|
|
|
|
end
|
|
|
|
|
|
2020-01-06 22:49:55 +02:00
|
|
|
scenario 'edit proposal without cfp' do
|
|
|
|
|
conference = create(:conference)
|
|
|
|
|
proposal = create(:event, program: conference.program)
|
|
|
|
|
|
|
|
|
|
sign_in proposal.submitter
|
|
|
|
|
|
|
|
|
|
visit edit_conference_program_proposal_path(proposal.program.conference.short_title, proposal)
|
|
|
|
|
|
|
|
|
|
expect(page).to have_content 'Proposal Information'
|
|
|
|
|
end
|
|
|
|
|
|
2015-04-16 18:34:41 +03:00
|
|
|
scenario 'update a proposal' do
|
2015-10-25 13:29:02 +02:00
|
|
|
conference = create(:conference)
|
2018-10-18 12:01:42 -07:00
|
|
|
create(:cfp, program: conference.program)
|
2015-10-25 13:29:02 +02:00
|
|
|
proposal = create(:event, program: conference.program)
|
2015-04-16 18:34:41 +03:00
|
|
|
|
|
|
|
|
sign_in proposal.submitter
|
|
|
|
|
|
2015-10-25 13:29:02 +02:00
|
|
|
visit edit_conference_program_proposal_path(proposal.program.conference.short_title, proposal)
|
2015-04-16 18:34:41 +03:00
|
|
|
|
|
|
|
|
fill_in 'event_subtitle', with: 'My event subtitle'
|
|
|
|
|
select('Easy', from: 'event[difficulty_level_id]')
|
|
|
|
|
|
|
|
|
|
click_button 'Update Proposal'
|
2018-10-25 16:16:56 -07:00
|
|
|
page.find('#flash')
|
2017-07-20 17:30:27 +05:30
|
|
|
expect(page).to have_content 'Proposal was successfully updated.'
|
2015-04-16 18:34:41 +03:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
scenario 'signed_in user submits a valid proposal', feature: true, js: true do
|
2014-08-28 15:21:05 +02:00
|
|
|
sign_in participant_without_bio
|
|
|
|
|
expected_count = Event.count + 1
|
2018-11-16 11:57:51 -08:00
|
|
|
|
2016-09-14 22:42:04 -04:00
|
|
|
visit conference_program_proposals_path(conference.short_title)
|
2014-05-12 13:19:09 +02:00
|
|
|
click_link 'New Proposal'
|
2020-04-12 10:04:20 -07:00
|
|
|
expect(page).to have_selector(".in[id='#{find_field('event[event_type_id]').value}-help']") # End of animation
|
2014-05-12 13:19:09 +02:00
|
|
|
|
|
|
|
|
fill_in 'event_title', with: 'Example Proposal'
|
|
|
|
|
select('Example Event Type', from: 'event[event_type_id]')
|
2020-04-12 10:04:20 -07:00
|
|
|
expect(page).to have_selector(".in[id='#{find_field('event[event_type_id]').value}-help']") # End of animation
|
|
|
|
|
|
2021-03-08 02:13:57 -08:00
|
|
|
expect(page).to have_text('Example Event Description')
|
2014-05-12 13:19:09 +02:00
|
|
|
fill_in 'event_abstract', with: 'Lorem ipsum abstract'
|
2019-03-15 14:36:43 +01:00
|
|
|
expect(page).to have_text('You have used 3 words')
|
2018-11-28 13:07:44 -08:00
|
|
|
|
2021-02-17 17:27:41 -08:00
|
|
|
fill_in 'event_submission_text', with: 'Lorem ipsum submission_text'
|
2021-03-08 02:13:57 -08:00
|
|
|
expect(page).to have_text('Submission text')
|
|
|
|
|
# Submission Instructions content
|
|
|
|
|
expect(page).to have_text('Example Event Instructions')
|
|
|
|
|
|
2019-03-15 14:36:43 +01:00
|
|
|
click_link 'Do you require something special?'
|
2014-05-12 13:19:09 +02:00
|
|
|
fill_in 'event_description', with: 'Lorem ipsum description'
|
2019-03-15 14:36:43 +01:00
|
|
|
|
2021-02-23 21:42:42 -08:00
|
|
|
click_button 'Submit Proposal'
|
2018-11-28 13:07:44 -08:00
|
|
|
|
2018-10-25 16:16:56 -07:00
|
|
|
page.find('#flash')
|
2017-07-20 17:30:27 +05:30
|
|
|
expect(page).to have_content 'Proposal was successfully submitted.'
|
2016-09-14 22:42:04 -04:00
|
|
|
expect(current_path).to eq(conference_program_proposals_path(conference.short_title))
|
2014-05-12 13:19:09 +02:00
|
|
|
expect(Event.count).to eq(expected_count)
|
2014-08-28 15:21:05 +02:00
|
|
|
end
|
2014-05-13 15:45:39 +02:00
|
|
|
|
2014-08-28 15:21:05 +02:00
|
|
|
scenario 'confirms a proposal', feature: true, js: true do
|
2014-05-13 15:45:39 +02:00
|
|
|
sign_in participant
|
2016-09-14 22:42:04 -04:00
|
|
|
visit conference_program_proposals_path(conference.short_title)
|
2017-07-20 17:30:27 +05:30
|
|
|
expect(page).to have_content 'Example Proposal'
|
2015-04-16 18:34:41 +03:00
|
|
|
expect(@event.state).to eq('unconfirmed')
|
2014-08-28 15:21:05 +02:00
|
|
|
click_link "confirm_proposal_#{@event.id}"
|
2017-07-20 17:30:27 +05:30
|
|
|
expect(page).to have_content 'The proposal was confirmed. Please register to attend the conference.'
|
2016-07-05 00:10:18 +05:30
|
|
|
expect(current_path).to eq(new_conference_conference_registration_path(conference.short_title))
|
2014-08-28 15:21:05 +02:00
|
|
|
@event.reload
|
|
|
|
|
expect(@event.state).to eq('confirmed')
|
|
|
|
|
end
|
2014-05-13 15:45:39 +02:00
|
|
|
|
2014-08-28 15:21:05 +02:00
|
|
|
scenario 'withdraw a proposal', feature: true, js: true do
|
|
|
|
|
sign_in participant
|
|
|
|
|
@event.confirm!
|
2016-09-14 22:42:04 -04:00
|
|
|
visit conference_program_proposals_path(conference.short_title)
|
2017-07-20 17:30:27 +05:30
|
|
|
expect(page).to have_content 'Example Proposal'
|
2014-08-28 15:21:05 +02:00
|
|
|
click_link "delete_proposal_#{@event.id}"
|
2018-10-25 16:16:56 -07:00
|
|
|
page.accept_alert
|
|
|
|
|
page.find('#flash')
|
2017-07-20 17:30:27 +05:30
|
|
|
expect(page).to have_content 'Proposal was successfully withdrawn.'
|
2014-08-28 15:21:05 +02:00
|
|
|
@event.reload
|
|
|
|
|
expect(@event.state).to eq('withdrawn')
|
2014-05-12 13:19:09 +02:00
|
|
|
end
|
2021-03-07 23:00:40 -08:00
|
|
|
|
|
|
|
|
scenario 'can reset to text template', feature: true, js: true do
|
|
|
|
|
event_type = conference.program.event_types[-1]
|
|
|
|
|
event_type.description = 'Example event description'
|
2021-03-23 12:33:41 -07:00
|
|
|
event_type.submission_instructions = '## Fill Me In!'
|
2021-03-07 23:00:40 -08:00
|
|
|
event_type.save!
|
|
|
|
|
|
|
|
|
|
sign_in participant
|
|
|
|
|
visit new_conference_program_proposal_path(conference.short_title)
|
|
|
|
|
|
|
|
|
|
fill_in 'event_title', with: 'Example Proposal'
|
|
|
|
|
select(event_type.title, from: 'event[event_type_id]')
|
|
|
|
|
fill_in 'event_submission_text', with: 'Lorem ipsum example submission text'
|
|
|
|
|
|
|
|
|
|
accept_confirm do
|
2021-03-23 23:06:34 -07:00
|
|
|
click_button 'Reset Submission to Template'
|
2021-03-07 23:00:40 -08:00
|
|
|
end
|
|
|
|
|
|
2021-03-24 02:28:43 -07:00
|
|
|
expect(page.find('#event_submission_text').value).to eq(event_type.submission_instructions)
|
2021-03-07 23:00:40 -08:00
|
|
|
end
|
2014-05-12 13:19:09 +02:00
|
|
|
end
|
2021-04-25 01:02:41 -07:00
|
|
|
|
2021-04-29 13:34:24 -07:00
|
|
|
|
2021-04-25 01:02:41 -07:00
|
|
|
context 'as a user, looking at a conference with scheduled events' do
|
|
|
|
|
before(:each) do
|
2021-04-25 01:03:41 -07:00
|
|
|
@user = create(:user)
|
2021-04-25 01:02:41 -07:00
|
|
|
@program = conference.program
|
2021-04-25 01:03:41 -07:00
|
|
|
@selected_schedule = create(:schedule, program: @program)
|
2021-04-25 01:02:41 -07:00
|
|
|
@program.update_attributes!(selected_schedule: @selected_schedule)
|
|
|
|
|
@scheduled_event1 = create(:event, program: @program, state: 'confirmed', abstract: '`markdown`')
|
2021-04-25 01:03:41 -07:00
|
|
|
@event_schedule1 = create(:event_schedule, event: @scheduled_event1, schedule: @selected_schedule, start_time: conference.start_hour + 1.hour)
|
2021-04-25 01:02:41 -07:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
scenario 'for a scheduled event, can add an event to google calendar if signed in', feature: true, js: true do
|
|
|
|
|
sign_in @user
|
|
|
|
|
visit conference_program_proposal_path(conference.short_title, @scheduled_event1.id)
|
|
|
|
|
expect(page).to have_content('Add to Google Calendar (beta)')
|
2021-04-25 01:03:41 -07:00
|
|
|
end
|
2021-04-25 01:02:41 -07:00
|
|
|
|
|
|
|
|
scenario 'for a scheduled event, cannot add an event to google calendar if not signed on', feature: true, js: true do
|
|
|
|
|
visit conference_program_proposal_path(conference.short_title, @scheduled_event1.id)
|
|
|
|
|
expect(page).not_to have_content('Add to Google Calendar (beta)')
|
2021-04-25 01:03:41 -07:00
|
|
|
end
|
2021-04-25 01:02:41 -07:00
|
|
|
end
|
2021-04-29 13:34:24 -07:00
|
|
|
|
2021-04-21 21:40:08 -07:00
|
|
|
context 'happening now or next section', feature: true, js: true do
|
|
|
|
|
let!(:conference1) { create(:full_conference, start_date: 1.day.ago, end_date: 7.days.from_now, start_hour: 0, end_hour: 24) }
|
|
|
|
|
let!(:program) { conference1.program }
|
|
|
|
|
let!(:selected_schedule) { create(:schedule, program: program) }
|
|
|
|
|
let!(:splashpage) { create(:full_splashpage, conference: conference1, public: true) }
|
|
|
|
|
|
|
|
|
|
let!(:scheduled_event1) do
|
|
|
|
|
program.update_attributes!(selected_schedule: selected_schedule)
|
|
|
|
|
create(:event, program: program, state: 'confirmed')
|
|
|
|
|
end
|
|
|
|
|
let!(:scheduled_event2) do
|
|
|
|
|
program.update_attributes!(selected_schedule: selected_schedule)
|
|
|
|
|
create(:event, program: program, state: 'confirmed')
|
|
|
|
|
end
|
|
|
|
|
let!(:scheduled_event3) do
|
|
|
|
|
program.update_attributes!(selected_schedule: selected_schedule)
|
|
|
|
|
create(:event, program: program, state: 'confirmed')
|
|
|
|
|
end
|
|
|
|
|
let!(:scheduled_event4) do
|
|
|
|
|
program.update_attributes!(selected_schedule: selected_schedule)
|
|
|
|
|
create(:event, program: program, state: 'confirmed')
|
|
|
|
|
end
|
|
|
|
|
let!(:current_time) { Time.now.in_time_zone(conference1.timezone) }
|
|
|
|
|
|
|
|
|
|
let!(:events_list) { [scheduled_event1, scheduled_event2, scheduled_event3, scheduled_event4] }
|
|
|
|
|
|
|
|
|
|
before :each do
|
|
|
|
|
sign_in participant
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
scenario 'No events happening now or next' do
|
|
|
|
|
events_list.each do |event|
|
|
|
|
|
visit conference_program_proposal_path(conference1.short_title, event.id)
|
|
|
|
|
happening_now = page.find('#happening-now')
|
|
|
|
|
expect(happening_now).to have_content('There are no events scheduled yet.')
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
scenario 'shows all events happening next if nothing is happening now' do
|
|
|
|
|
event_schedule1 = create(:event_schedule, event: scheduled_event1, schedule: selected_schedule, start_time: (current_time + 1.hour).strftime('%a, %d %b %Y %H:%M:%S'))
|
|
|
|
|
event_schedule2 = create(:event_schedule, event: scheduled_event2, schedule: selected_schedule, start_time: (current_time + 1.hour).strftime('%a, %d %b %Y %H:%M:%S'))
|
|
|
|
|
|
|
|
|
|
events_list.each do |event|
|
|
|
|
|
visit conference_program_proposal_path(conference1.short_title, event.id)
|
|
|
|
|
happening_now = page.find('#happening-now')
|
|
|
|
|
expect(happening_now).to have_content(event_schedule1.event.title)
|
|
|
|
|
expect(happening_now).to have_content(event_schedule2.event.title)
|
|
|
|
|
expect(happening_now).not_to have_content(scheduled_event3.title)
|
|
|
|
|
expect(happening_now).not_to have_content(scheduled_event4.title)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
scenario 'only shows all events happening now if something is happening now and next' do
|
|
|
|
|
event_schedule1 = create(:event_schedule, event: scheduled_event1, schedule: selected_schedule, start_time: (current_time + 1.hour).strftime('%a, %d %b %Y %H:%M:%S'))
|
|
|
|
|
event_schedule2 = create(:event_schedule, event: scheduled_event2, schedule: selected_schedule, start_time: (current_time + 1.hour).strftime('%a, %d %b %Y %H:%M:%S'))
|
|
|
|
|
event_schedule3 = create(:event_schedule, event: scheduled_event3, schedule: selected_schedule, start_time: current_time.strftime('%a, %d %b %Y %H:%M:%S'))
|
|
|
|
|
events_list.each do |event|
|
|
|
|
|
visit conference_program_proposal_path(conference1.short_title, event.id)
|
|
|
|
|
happening_now = page.find('#happening-now')
|
|
|
|
|
expect(happening_now).not_to have_content(event_schedule1.event.title)
|
|
|
|
|
expect(happening_now).not_to have_content(event_schedule2.event.title)
|
|
|
|
|
expect(happening_now).to have_content(event_schedule3.event.title)
|
|
|
|
|
expect(happening_now).not_to have_content(scheduled_event4.title)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
scenario 'only shows events happening at the earliest time, not at a later time in the future' do
|
|
|
|
|
event_schedule1 = create(:event_schedule, event: scheduled_event1, schedule: selected_schedule, start_time: (current_time + 1.hour).strftime('%a, %d %b %Y %H:%M:%S'))
|
|
|
|
|
event_schedule2 = create(:event_schedule, event: scheduled_event2, schedule: selected_schedule, start_time: (current_time + 1.hour).strftime('%a, %d %b %Y %H:%M:%S'))
|
|
|
|
|
event_schedule3 = create(:event_schedule, event: scheduled_event3, schedule: selected_schedule, start_time: (current_time + 2.hours).strftime('%a, %d %b %Y %H:%M:%S'))
|
|
|
|
|
events_list.each do |event|
|
|
|
|
|
visit conference_program_proposal_path(conference1.short_title, event.id)
|
|
|
|
|
happening_now = page.find('#happening-now')
|
|
|
|
|
expect(happening_now).to have_content(event_schedule1.event.title)
|
|
|
|
|
expect(happening_now).to have_content(event_schedule2.event.title)
|
|
|
|
|
expect(happening_now).not_to have_content(event_schedule3.event.title)
|
|
|
|
|
expect(happening_now).not_to have_content(scheduled_event4.title)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
scenario 'only shows 3 events happening now because of pagination' do
|
|
|
|
|
event_schedule1 = create(:event_schedule, event: scheduled_event1, schedule: selected_schedule, start_time: current_time.strftime('%a, %d %b %Y %H:%M:%S'))
|
|
|
|
|
event_schedule2 = create(:event_schedule, event: scheduled_event2, schedule: selected_schedule, start_time: current_time.strftime('%a, %d %b %Y %H:%M:%S'))
|
|
|
|
|
event_schedule3 = create(:event_schedule, event: scheduled_event3, schedule: selected_schedule, start_time: current_time.strftime('%a, %d %b %Y %H:%M:%S'))
|
|
|
|
|
event_schedule4 = create(:event_schedule, event: scheduled_event4, schedule: selected_schedule, start_time: current_time.strftime('%a, %d %b %Y %H:%M:%S'))
|
|
|
|
|
|
|
|
|
|
events_list.each do |event|
|
|
|
|
|
visit conference_program_proposal_path(conference1.short_title, event.id)
|
|
|
|
|
happening_now = page.find('#happening-now')
|
|
|
|
|
expect(happening_now).to have_content(event_schedule1.event.title)
|
|
|
|
|
expect(happening_now).to have_content(event_schedule2.event.title)
|
|
|
|
|
expect(happening_now).to have_content(event_schedule3.event.title)
|
|
|
|
|
|
|
|
|
|
visit conference_program_proposal_path(conference1.short_title, event.id, page: 2)
|
|
|
|
|
happening_now = page.find('#happening-now')
|
|
|
|
|
expect(happening_now).not_to have_content(event_schedule3.event.title)
|
|
|
|
|
expect(happening_now).not_to have_content(event_schedule1.event.title)
|
|
|
|
|
expect(happening_now).not_to have_content(event_schedule2.event.title)
|
|
|
|
|
|
|
|
|
|
expect(happening_now).to have_content(event_schedule4.event.title)
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
2014-05-12 13:19:09 +02:00
|
|
|
end
|