diff --git a/spec/selenium/conversations_attachments_spec.rb b/spec/selenium/conversations_attachments_spec.rb index 1cff78729e1..dbdc6e31434 100644 --- a/spec/selenium/conversations_attachments_spec.rb +++ b/spec/selenium/conversations_attachments_spec.rb @@ -41,11 +41,10 @@ shared_examples_for "conversations attachments selenium tests" do add_recipient("student1") add_recipient("student2") add_recipient("student3") - enable_jobs do - expect { - submit_message_form(:attachments => [fullpath], :add_recipient => false, :group_conversation => false) - }.to change(Attachment, :count).by(1) - end + ConversationBatch.any_instance.stubs(:mode).returns(:sync) + expect { + submit_message_form(:attachments => [fullpath], :add_recipient => false, :group_conversation => false) + }.to change(Attachment, :count).by(1) end it "should save attachments on new messages on existing conversations" do diff --git a/spec/selenium/conversations_sent_filter_spec.rb b/spec/selenium/conversations_sent_filter_spec.rb index 068bf6a5755..f1ad786caa3 100644 --- a/spec/selenium/conversations_sent_filter_spec.rb +++ b/spec/selenium/conversations_sent_filter_spec.rb @@ -60,9 +60,8 @@ describe "conversations sent filter" do add_recipient("student2") add_recipient("student3") - enable_jobs do - submit_message_form(:message => message_text, :add_recipient => false, :group_conversation => false) - end + ConversationBatch.any_instance.stubs(:mode).returns(:sync) + submit_message_form(:message => message_text, :add_recipient => false, :group_conversation => false) conversations = get_conversations conversations.size.should == 3 diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 229a7c52be3..daef1e3ab90 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -897,19 +897,6 @@ Spec::Runner.configure do |config| end end - def enable_jobs - job_thread = Thread.new do - Thread.current[:done] = false - while !Thread.current[:done] - run_jobs - sleep 1 - end - end - yield - job_thread[:done] = true - job_thread.join - end - def track_jobs @jobs_tracking = Delayed::JobTracking.track { yield } end