[ARVADOS] updated: f4180d151eacadf1455b2ebe43ecb61cb095df7c

git at public.curoverse.com git at public.curoverse.com
Mon Jul 27 10:05:45 EDT 2015


Summary of changes:
 services/api/test/integration/websocket_test.rb | 21 ++++++---------------
 1 file changed, 6 insertions(+), 15 deletions(-)

       via  f4180d151eacadf1455b2ebe43ecb61cb095df7c (commit)
      from  171ac077e7335978007daf8199559290e73b8180 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit f4180d151eacadf1455b2ebe43ecb61cb095df7c
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Mon Jul 27 10:06:37 2015 -0400

    6451: Refactor tests slightly to call subscribe_test() in two places.

diff --git a/services/api/test/integration/websocket_test.rb b/services/api/test/integration/websocket_test.rb
index ef24f55..c4d6d5e 100644
--- a/services/api/test/integration/websocket_test.rb
+++ b/services/api/test/integration/websocket_test.rb
@@ -84,7 +84,7 @@ class WebsocketTest < ActionDispatch::IntegrationTest
     assert_equal 200, status
   end
 
-  test "connect, subscribe, get event" do
+  def subscribe_test
     state = 1
     spec = nil
     ev_uuid = nil
@@ -115,6 +115,10 @@ class WebsocketTest < ActionDispatch::IntegrationTest
     assert_equal spec.uuid, ev_uuid
   end
 
+  test "connect, subscribe, get event" do
+    subscribe_test()
+  end
+
   test "connect, subscribe, get two events" do
     state = 1
     spec = nil
@@ -682,20 +686,7 @@ class WebsocketTest < ActionDispatch::IntegrationTest
 
     # Try connecting again, ensure that websockets server is still running and
     # didn't crash per #6451
-    status = nil
-    ws_helper :admin do |ws|
-      ws.on :open do |event|
-        ws.send ({method: 'subscribe'}.to_json)
-      end
-
-      ws.on :message do |event|
-        d = Oj.load event.data
-        status = d["status"]
-        ws.close
-      end
-    end
-
-    assert_equal 200, status
+    subscribe_test()
 
   end
 

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list