Merge pull request #12 from CactusPuppy/176895037-add-link-to-view-event-from-admin-page
Add link to view event from admin page
This commit is contained in:
commit
9ee29f6daa
2 changed files with 17 additions and 0 deletions
|
|
@ -7,6 +7,8 @@
|
|||
%small
|
||||
= @event.subtitle
|
||||
.btn-group.pull-right
|
||||
- if @event.public
|
||||
= link_to 'Preview', conference_program_proposal_path(@conference.short_title, @event.id), class: 'btn btn-mini btn-primary'
|
||||
= link_to 'Registrations', registrations_admin_conference_program_event_path(@conference.short_title, @event), class: 'btn btn-success'
|
||||
= link_to 'Edit', edit_admin_conference_program_event_path(@conference.short_title, @event), class: 'btn btn-mini btn-primary'
|
||||
|
||||
|
|
|
|||
|
|
@ -27,6 +27,21 @@ feature Event do
|
|||
sign_in organizer
|
||||
end
|
||||
|
||||
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
|
||||
|
||||
scenario 'rejects a proposal', feature: true, js: true do
|
||||
visit admin_conference_program_events_path(conference.short_title)
|
||||
expect(page).to have_content 'Example Proposal'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue