Remove travel schedule from registration

(cherry picked from commit d18cc02f0185df39bb4213d8a63a955dfb433dcb)
Re: https://github.com/openSUSE/osem/issues/2333
This commit is contained in:
James Mason 2018-12-29 15:36:17 -08:00 committed by Henne Vogelsang
parent ab0ff0ff03
commit 7a04f3582f
No known key found for this signature in database
GPG key ID: 9D6164C2955FADE0
16 changed files with 29 additions and 144 deletions

View file

@ -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