From 7533dc6b036385d3f344eaaab2525debf5aa3309 Mon Sep 17 00:00:00 2001 From: Petko Bordjukov Date: Tue, 8 Jan 2019 00:36:25 +0200 Subject: [PATCH] Fix the legacy specs --- ...call_for_participations_controller_spec.rb | 25 ------------------- spec/factories/conferences.rb | 1 + spec/factories/event_types.rb | 2 ++ spec/factories/events.rb | 9 +++++++ 4 files changed, 12 insertions(+), 25 deletions(-) delete mode 100644 spec/controllers/management/call_for_participations_controller_spec.rb diff --git a/spec/controllers/management/call_for_participations_controller_spec.rb b/spec/controllers/management/call_for_participations_controller_spec.rb deleted file mode 100644 index 5723b6f..0000000 --- a/spec/controllers/management/call_for_participations_controller_spec.rb +++ /dev/null @@ -1,25 +0,0 @@ -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 diff --git a/spec/factories/conferences.rb b/spec/factories/conferences.rb index a0c7672..cff6017 100644 --- a/spec/factories/conferences.rb +++ b/spec/factories/conferences.rb @@ -7,6 +7,7 @@ FactoryGirl.define do description 'MyText' start_date '2014-07-29 21:29:13' end_date '2014-07-31 21:29:13' + planned_cfp_end_date '2014-07-28' factory :past_conference do start_date Date.today - 10.days diff --git a/spec/factories/event_types.rb b/spec/factories/event_types.rb index 33e3327..6f5f857 100644 --- a/spec/factories/event_types.rb +++ b/spec/factories/event_types.rb @@ -3,5 +3,7 @@ FactoryGirl.define do name { |n| "Track #{n}" } description 'MyText' conference + minimum_length '45' + maximum_length '60' end end diff --git a/spec/factories/events.rb b/spec/factories/events.rb index c690e32..60837cb 100644 --- a/spec/factories/events.rb +++ b/spec/factories/events.rb @@ -4,5 +4,14 @@ FactoryGirl.define do length { 60 } abstract { 'foo' } description { 'foo' } + conference + language :bg + after(:build) do |event, evaluator| + evaluator.conference.tracks << create(:track) + event.track = evaluator.conference.tracks.first + + evaluator.conference.event_types << create(:event_type) + event.event_type = evaluator.conference.event_types.first + end end end