mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Remove travel schedule from registration
(cherry picked from commit d18cc02f0185df39bb4213d8a63a955dfb433dcb) Re: https://github.com/openSUSE/osem/issues/2333
This commit is contained in:
parent
ab0ff0ff03
commit
7a04f3582f
16 changed files with 29 additions and 144 deletions
|
|
@ -290,14 +290,15 @@ describe ConferenceRegistrationsController, type: :controller do
|
|||
before do
|
||||
@registration = create(:registration,
|
||||
conference: conference,
|
||||
user: user,
|
||||
arrival: Date.new(2014, 04, 25))
|
||||
user: user)
|
||||
end
|
||||
|
||||
context 'updates successfully' do
|
||||
before do
|
||||
patch :update, params: { registration: attributes_for(:registration, arrival: Date.new(2014, 04, 29)),
|
||||
conference_id: conference.short_title }
|
||||
patch :update, params: {
|
||||
registration: attributes_for(:registration, volunteer: true),
|
||||
conference_id: conference.short_title
|
||||
}
|
||||
end
|
||||
|
||||
it 'redirects to registration show path' do
|
||||
|
|
@ -309,16 +310,17 @@ describe ConferenceRegistrationsController, type: :controller do
|
|||
end
|
||||
|
||||
it 'updates the registration' do
|
||||
@registration.reload
|
||||
expect(@registration.arrival).to eq Date.new(2014, 04, 29)
|
||||
expect{ @registration.reload }.to change(@registration, :updated_at)
|
||||
end
|
||||
end
|
||||
|
||||
context 'update fails' do
|
||||
before do
|
||||
allow_any_instance_of(Registration).to receive(:update_attributes).and_return(false)
|
||||
patch :update, params: { registration: attributes_for(:registration, arrival: Date.new(2014, 04, 27)),
|
||||
conference_id: conference.short_title }
|
||||
patch :update, params: {
|
||||
registration: attributes_for(:registration, volunteer: true),
|
||||
conference_id: conference.short_title
|
||||
}
|
||||
end
|
||||
|
||||
it 'renders edit template' do
|
||||
|
|
@ -331,7 +333,7 @@ describe ConferenceRegistrationsController, type: :controller do
|
|||
|
||||
it 'does not update the registration' do
|
||||
@registration.reload
|
||||
expect(@registration.arrival).to eq Date.new(2014, 04, 25)
|
||||
expect { @registration.reload }.not_to change(@registration, :updated_at)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue