assert_equal(403,multi.responses[:succeeded][i].response_header.status,"Channel was created")
assert_equal(0,multi.responses[:succeeded][i].response_header.content_length,"Received response for creating channel with id containing wildcard")
assert_equal("Channel id not authorized for this method.",multi.responses[:succeeded][i].response_header['X_NGINX_PUSHSTREAM_EXPLAIN'],"Didn't receive the right error message")
assert_equal(3,multi.responses[:callback].length)
multi.responses[:callback].eachdo|name,response|
assert_equal(403,response.response_header.status,"Channel was created")
assert_equal(0,response.response_header.content_length,"Received response for creating channel with id containing wildcard")
assert_equal("Channel id not authorized for this method.",response.response_header['X_NGINX_PUSHSTREAM_EXPLAIN'],"Didn't receive the right error message")
assert_equal(403,multi.responses[:succeeded][i].response_header.status,"Channel was created")
assert_equal(0,multi.responses[:succeeded][i].response_header.content_length,"Received response for creating channel with id containing wildcard")
assert_equal("Channel id not authorized for this method.",multi.responses[:succeeded][i].response_header['X_NGINX_PUSHSTREAM_EXPLAIN'],"Didn't receive the right error message")
assert_equal(3,multi.responses[:callback].length)
multi.responses[:callback].eachdo|name,response|
assert_equal(403,response.response_header.status,"Channel was created")
assert_equal(0,response.response_header.content_length,"Received response for creating channel with id containing wildcard")
assert_equal("Channel id not authorized for this method.",response.response_header['X_NGINX_PUSHSTREAM_EXPLAIN'],"Didn't receive the right error message")
assert_equal(403,multi.responses[:succeeded][i].response_header.status,"Channel was created")
assert_equal(0,multi.responses[:succeeded][i].response_header.content_length,"Received response for creating channel with id containing wildcard")
assert_equal("Channel id not authorized for this method.",multi.responses[:succeeded][i].response_header['X_NGINX_PUSHSTREAM_EXPLAIN'],"Didn't receive the right error message")
assert_equal(3,multi.responses[:callback].length)
multi.responses[:callback].eachdo|name,response|
assert_equal(403,response.response_header.status,"Channel was created")
assert_equal(0,response.response_header.content_length,"Received response for creating channel with id containing wildcard")
assert_equal("Channel id not authorized for this method.",response.response_header['X_NGINX_PUSHSTREAM_EXPLAIN'],"Didn't receive the right error message")
end
EventMachine.stop
...
...
@@ -167,29 +167,29 @@ class TestSubscriber < Test::Unit::TestCase
assert_equal(0,multi.responses[:succeeded][0].response_header.content_length,"Should response only with headers")
assert_equal(403,multi.responses[:succeeded][0].response_header.status,"Request was not understood as a bad request")
assert_equal("Subscribed too much broadcast channels.",multi.responses[:succeeded][0].response_header['X_NGINX_PUSHSTREAM_EXPLAIN'],"Didn't receive the right error message")
assert_equal(nginx_address+'/sub/bd_test_broadcast_channels_without_common_channel',multi.responses[:succeeded][0].uri.to_s,"Array is with wrong order")
assert_equal(0,multi.responses[:callback][:a].response_header.content_length,"Should response only with headers")
assert_equal(403,multi.responses[:callback][:a].response_header.status,"Request was not understood as a bad request")
assert_equal("Subscribed too much broadcast channels.",multi.responses[:callback][:a].response_header['X_NGINX_PUSHSTREAM_EXPLAIN'],"Didn't receive the right error message")
assert_equal(nginx_address+'/sub/bd_test_broadcast_channels_without_common_channel',multi.responses[:callback][:a].req.uri.to_s,"Array is with wrong order")
assert_equal(0,multi.responses[:succeeded][1].response_header.content_length,"Should response only with headers")
assert_equal(403,multi.responses[:succeeded][1].response_header.status,"Request was not understood as a bad request")
assert_equal("Subscribed too much broadcast channels.",multi.responses[:succeeded][1].response_header['X_NGINX_PUSHSTREAM_EXPLAIN'],"Didn't receive the right error message")
assert_equal(nginx_address+'/sub/bd_',multi.responses[:succeeded][1].uri.to_s,"Array is with wrong order")
assert_equal(0,multi.responses[:callback][:b].response_header.content_length,"Should response only with headers")
assert_equal(403,multi.responses[:callback][:b].response_header.status,"Request was not understood as a bad request")
assert_equal("Subscribed too much broadcast channels.",multi.responses[:callback][:b].response_header['X_NGINX_PUSHSTREAM_EXPLAIN'],"Didn't receive the right error message")
assert_equal(nginx_address+'/sub/bd_',multi.responses[:callback][:b].req.uri.to_s,"Array is with wrong order")
assert_equal(200,multi.responses[:succeeded][2].response_header.status,"Channel id starting with different prefix from broadcast was not accept")
assert_equal(nginx_address+'/sub/bd1',multi.responses[:succeeded][2].uri.to_s,"Array is with wrong order")
assert_equal(200,multi.responses[:callback][:c].response_header.status,"Channel id starting with different prefix from broadcast was not accept")
assert_equal(nginx_address+'/sub/bd1',multi.responses[:callback][:c].req.uri.to_s,"Array is with wrong order")
assert_equal(200,multi.responses[:succeeded][3].response_header.status,"Channel id starting with different prefix from broadcast was not accept")
assert_equal(nginx_address+'/sub/bd',multi.responses[:succeeded][3].uri.to_s,"Array is with wrong order")
assert_equal(200,multi.responses[:callback][:d].response_header.status,"Channel id starting with different prefix from broadcast was not accept")
assert_equal(nginx_address+'/sub/bd',multi.responses[:callback][:d].req.uri.to_s,"Array is with wrong order")
EventMachine.stop
}
...
...
@@ -209,27 +209,27 @@ class TestSubscriber < Test::Unit::TestCase
assert_equal(0,multi.responses[:succeeded][0].response_header.content_length,"Should response only with headers")
assert_equal(403,multi.responses[:succeeded][0].response_header.status,"Request was not understood as a bad request")
assert_equal("Subscribed too much broadcast channels.",multi.responses[:succeeded][0].response_header['X_NGINX_PUSHSTREAM_EXPLAIN'],"Didn't receive the right error message")
assert_equal(nginx_address+'/sub/bd1/bd2/bd3/bd4/bd_1/bd_2/bd_3',multi.responses[:succeeded][0].uri.to_s,"Array is with wrong order")
assert_equal(0,multi.responses[:callback][:a].response_header.content_length,"Should response only with headers")
assert_equal(403,multi.responses[:callback][:a].response_header.status,"Request was not understood as a bad request")
assert_equal("Subscribed too much broadcast channels.",multi.responses[:callback][:a].response_header['X_NGINX_PUSHSTREAM_EXPLAIN'],"Didn't receive the right error message")
assert_equal(nginx_address+'/sub/bd1/bd2/bd3/bd4/bd_1/bd_2/bd_3',multi.responses[:callback][:a].req.uri.to_s,"Array is with wrong order")
assert_equal(200,multi.responses[:succeeded][1].response_header.status,"Request was not understood as a bad request")
assert_equal(nginx_address+'/sub/bd1/bd2/bd_1/bd_2',multi.responses[:succeeded][1].uri.to_s,"Array is with wrong order")
assert_equal(200,multi.responses[:callback][:b].response_header.status,"Request was not understood as a bad request")
assert_equal(nginx_address+'/sub/bd1/bd2/bd_1/bd_2',multi.responses[:callback][:b].req.uri.to_s,"Array is with wrong order")
assert_equal(200,multi.responses[:succeeded][2].response_header.status,"Channel id starting with different prefix from broadcast was not accept")
assert_equal(nginx_address+'/sub/bd1/bd_1',multi.responses[:succeeded][2].uri.to_s,"Array is with wrong order")
assert_equal(200,multi.responses[:callback][:c].response_header.status,"Channel id starting with different prefix from broadcast was not accept")
assert_equal(nginx_address+'/sub/bd1/bd_1',multi.responses[:callback][:c].req.uri.to_s,"Array is with wrong order")
assert_equal(200,multi.responses[:succeeded][3].response_header.status,"Channel id starting with different prefix from broadcast was not accept")
assert_equal(nginx_address+'/sub/bd1/bd2',multi.responses[:succeeded][3].uri.to_s,"Array is with wrong order")
assert_equal(200,multi.responses[:callback][:d].response_header.status,"Channel id starting with different prefix from broadcast was not accept")
assert_equal(nginx_address+'/sub/bd1/bd2',multi.responses[:callback][:d].req.uri.to_s,"Array is with wrong order")