clarion/spec/controllers/management/call_for_participations_controller_spec.rb
Petko Bordjukov 2b64461ac9 Implement changing of the status of the CFP
Allow a user to start and end a call for participation from the
conference list.
2015-05-24 01:17:42 +03:00

26 lines
852 B
Ruby

require 'rails_helper'
RSpec.describe Management::CallForParticipationsController, type: :controller do
let(:user) { create :administrator }
let(:conference) { create :conference }
before { sign_in user }
describe 'POST #create' do
it 'opens the CFP of the specified conference' do
expect do
post 'create', conference_id: conference.id, format: :js
end.to change { Conference.find(conference.id).call_for_participation.in_progress? }.from(false).to(true)
end
end
describe 'DELETE #destroy' do
it 'closes the CFP of the specified conference' do
conference.call_for_participation.open!
expect do
delete 'destroy', conference_id: conference.id, format: :js
end.to change { Conference.find(conference.id).call_for_participation.in_progress? }.from(true).to(false)
end
end
end