multiple changes
fix blind voting added more tests
This commit is contained in:
parent
ebe5fb704d
commit
e92114a257
2 changed files with 43 additions and 10 deletions
|
|
@ -17,16 +17,16 @@
|
|||
Voters
|
||||
%td
|
||||
= raters(@votable_fields)
|
||||
%table.table
|
||||
%thead
|
||||
%table.table
|
||||
%thead
|
||||
%td.col-md-2
|
||||
%b Your Votes
|
||||
- @votable_fields.each do |field|
|
||||
%tr
|
||||
%td.col-md-2
|
||||
%b Your Votes
|
||||
- @votable_fields.each do |field|
|
||||
%tr
|
||||
%td.col-md-2
|
||||
= field.title
|
||||
%td
|
||||
= rating_for_user @event, current_user, field.title, star: field.stars
|
||||
= field.title
|
||||
%td
|
||||
= rating_for_user @event, current_user, field.title, star: field.stars
|
||||
- else
|
||||
%b
|
||||
= voting_open_or_close(@program)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue