This commit is contained in:
Shlok Srivastava 2017-05-08 15:53:26 +00:00 committed by GitHub
commit aa974489df
69 changed files with 1371 additions and 377 deletions

View file

@ -12,19 +12,5 @@ feature Program do
sign_in organizer
end
scenario 'changes rating', feature: true, js: true do
visit admin_conference_program_path(conference.short_title)
click_link 'Edit'
fill_in 'program_rating', with: '4'
click_button 'Update Program'
# Validations
expect(flash)
.to eq('The program was successfully updated.')
expect(find('#rating').text).to eq('4')
end
end
end

View file

@ -15,6 +15,7 @@ feature Event do
@event = create(:event, program: conference.program, title: 'Example Proposal')
@event.event_users.create(user: participant, event_role: 'submitter')
@event.event_users.create(user: participant, event_role: 'speaker')
create(:votable_field, conference: conference, for_admin: true)
end
after(:each) do
@ -26,6 +27,38 @@ feature Event do
sign_in organizer
end
scenario 'for program with voting enabled can successfully vote' do
conference.program.update(rating_enabled: true, voting_start_date: Date.current - 1, voting_end_date: Date.current + 1)
visit admin_conference_program_event_path(conference.short_title, @event)
expect(page.has_content?('Overall Votes')).to eq true
expect(page.has_content?('Your Votes')).to eq true
end
scenario 'for program with voting disabled cannot successfuly vote' do
conference.program.update(rating_enabled: false, voting_start_date: Date.today, voting_end_date: Date.today + 1)
visit admin_conference_program_event_path(conference.short_title, @event)
expect(page.has_content?('Overall Votes')).to eq false
expect(page.has_content?('Your Votes')).to eq false
end
scenario 'for program with blind voting enabled cannot see overall votes' do
conference.program.update(rating_enabled: true, voting_start_date: Date.today, voting_end_date: Date.today + 1, blind_voting: true)
visit admin_conference_program_event_path(conference.short_title, @event)
expect(page.has_content?('Overall Votes')).to eq false
expect(page.has_content?('Your Votes')).to eq true
end
scenario 'for program with blind voting disabled can see overall votes' do
conference.program.update(rating_enabled: true, voting_start_date: Date.today, voting_end_date: Date.today + 1, blind_voting: false)
visit admin_conference_program_event_path(conference.short_title, @event)
expect(page.has_content?('Overall Votes')).to eq true
expect(page.has_content?('Your Votes')).to eq true
end
scenario 'rejects a proposal', feature: true, js: true do
visit admin_conference_program_events_path(conference.short_title)
expect(page.has_content?('Example Proposal')).to be true

View file

@ -21,15 +21,6 @@ feature 'Version' do
expect(page).to have_text("#{organizer.name} updated social tag, email, googleplus and sponsor email of contact details in conference #{conference.short_title}")
end
scenario 'display changes in program', feature: true, versioning: true, js: true do
visit edit_admin_conference_program_path(conference.short_title)
fill_in 'program_rating', with: '4'
click_button 'Update Program'
visit admin_revision_history_path
expect(page).to have_text("#{organizer.name} updated rating of program in conference #{conference.short_title}")
end
scenario 'display changes in cfp', feature: true, versioning: true, js: true do
cfp = create(:cfp, program: conference.program)
cfp.update_attributes(start_date: (Date.today + 1).strftime('%d/%m/%Y'), end_date: (Date.today + 3).strftime('%d/%m/%Y'))
@ -346,20 +337,6 @@ feature 'Version' do
expect(page).to have_text("Someone (probably via the console) re-added #{organizer.name}'s comment on event #{event.title} in conference #{conference.short_title}")
end
scenario 'display changes in vote', feature: true, versioning: true, js: true do
conference.program.rating = 1
create(:event, program: conference.program, title: 'My first event')
event = create(:event, program: conference.program, title: 'My second event')
create(:vote, user: organizer, event: event)
Vote.last.destroy
PaperTrail::Version.last.reify.save
visit admin_revision_history_path
expect(page).to have_text("Someone (probably via the console) voted on event My second event in conference #{conference.short_title}")
expect(page).to have_text("Someone (probably via the console) deleted #{organizer.name}'s vote on event #{event.title} in conference #{conference.short_title}")
expect(page).to have_text("Someone (probably via the console) re-added #{organizer.name}'s vote on event #{event.title} in conference #{conference.short_title}")
end
scenario 'display changes in campaign', feature: true, versioning: true, js: true do
campaign = create(:campaign, conference: conference, name: 'Test Campaign', utm_campaign: 'campaign')
campaign.update_attributes(utm_source: 'source', utm_medium: 'medium', utm_term: 'term', utm_content: 'content')