2019-03-06 15:55:10 +01:00
# frozen_string_literal: true
require 'spec_helper'
describe Admin :: CfpsController do
let! ( :today ) { Date . today }
let! ( :conference ) { create ( :conference , start_date : today + 20 . days , end_date : today + 30 . days ) }
2019-03-13 10:31:42 +01:00
let! ( :organizer ) { create ( :organizer , resource : conference ) }
2019-03-06 15:55:10 +01:00
let ( :cfp ) { create ( :cfp , program : conference . program ) }
before { sign_in ( organizer ) }
describe 'POST #create' do
2026-08-12 18:54:26 +05:30
it 'succeeds' do
2019-05-13 17:42:09 +02:00
post :create , params : { conference_id : conference . short_title , cfp : { cfp_type : 'events' , start_date : today , end_date : today + 6 . days , description : 'We call for papers, or tabak, or you know what!' } }
2019-03-06 15:55:10 +01:00
expect ( flash [ :notice ] ) . to match ( 'Call for papers successfully created.' )
end
end
describe 'POST #update' do
2026-08-12 18:54:26 +05:30
it 'succeeds' do
2019-05-13 17:42:09 +02:00
patch :update , params : { conference_id : conference . short_title , id : cfp . id , cfp : { end_date : today + 10 . days } }
2019-03-06 15:55:10 +01:00
expect ( flash [ :notice ] ) . to match ( 'Call for papers successfully updated.' )
end
end
end