Fix authorization of new and create in ConferenceRegistrationsController
Before authorization we need to set conference relation. Change in proposal spec cause conference has to have valid registration period for successful redirect to registration after confirm proposal.
This commit is contained in:
parent
10ef898a0d
commit
eae6d90e9f
4 changed files with 27 additions and 5 deletions
|
|
@ -2,6 +2,7 @@ require 'spec_helper'
|
|||
|
||||
feature Event do
|
||||
let!(:conference) { create(:conference) }
|
||||
let!(:registration_period) { create(:registration_period, conference: conference, start_date: Date.current) }
|
||||
let!(:cfp) { create(:cfp, program_id: conference.program.id) }
|
||||
let!(:organizer_role) { Role.find_by(name: 'organizer', resource: conference) }
|
||||
let!(:organizer) { create(:user, email: 'admin@example.com', role_ids: [organizer_role.id]) }
|
||||
|
|
@ -134,6 +135,7 @@ feature Event do
|
|||
click_link "confirm_proposal_#{@event.id}"
|
||||
expect(flash).
|
||||
to eq('The proposal was confirmed. Please register to attend the conference.')
|
||||
expect(current_path).to eq(new_conference_conference_registrations_path(conference.short_title))
|
||||
@event.reload
|
||||
expect(@event.state).to eq('confirmed')
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue