Commit 404845b8387b9e3eb5176a4031200d715ba75ff6

Authored by Antonio Terceiro
1 parent f36312b6

Skip one chat test if dependencies are not available

Showing 1 changed file with 16 additions and 8 deletions   Show diff stats
test/functional/chat_controller_test.rb
... ... @@ -63,14 +63,22 @@ class ChatControllerTest < ActionController::TestCase
63 63 assert_template 'auto_connect_busy'
64 64 end
65 65  
66   - should 'try to start xmpp session' do
67   - login_as 'testuser'
68   -
69   - RubyBOSH.expects(:initialize_session).raises("Error trying to connect...")
70   -
71   - get :start_session
72   - assert_response 500
73   - assert_template 'start_session_error'
  66 + begin
  67 + require 'ruby_bosh'
  68 + should 'try to start xmpp session' do
  69 + login_as 'testuser'
  70 +
  71 + RubyBOSH.expects(:initialize_session).raises("Error trying to connect...")
  72 +
  73 + get :start_session
  74 + assert_response 500
  75 + assert_template 'start_session_error'
  76 + end
  77 + rescue LoadError
  78 + puts 'W: could not load RubyBOSH; skipping some chat tests'
  79 + should 'skip the above test if the chat dependencies are not installed' do
  80 + print '*'
  81 + end
74 82 end
75 83  
76 84 should 'render not found if chat feature disabled' do
... ...