Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nginx-push-stream-module
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
nginx-push-stream-module
Commits
870d211b
Commit
870d211b
authored
Mar 02, 2011
by
Wandenberg Peixoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changing channels names and fix return method when receive a 403
parent
4e269359
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
7 deletions
+3
-7
test_broadcast_properties.rb
test/test_broadcast_properties.rb
+3
-7
No files found.
test/test_broadcast_properties.rb
View file @
870d211b
require
'rubygems'
require
'em-http'
require
'test/unit'
require
File
.
expand_path
(
'base_test_case'
,
File
.
dirname
(
__FILE__
))
class
TestBroadcastProperties
<
Test
::
Unit
::
TestCase
...
...
@@ -14,7 +11,7 @@ class TestBroadcastProperties < Test::Unit::TestCase
end
def
test_broadcast_channel_prefix
channel
=
'ch
1
'
channel
=
'ch
_test_broadcast_channel_prefix
'
channel_broad
=
'XXX_123'
channel_broad_fail
=
'YYY_123'
headers
=
{
'accept'
=>
'text/html'
}
...
...
@@ -49,7 +46,7 @@ class TestBroadcastProperties < Test::Unit::TestCase
end
def
test_broadcast_channel_max_qtd
channel
=
'ch
2
'
channel
=
'ch
_test_broadcast_channel_max_qtd
'
channel_broad1
=
'XXX_123'
channel_broad2
=
'XXX_321'
channel_broad3
=
'XXX_213'
...
...
@@ -60,9 +57,8 @@ class TestBroadcastProperties < Test::Unit::TestCase
pub
=
EventMachine
::
HttpRequest
.
new
(
nginx_address
+
'/pub?id='
+
channel
.
to_s
).
post
:head
=>
headers
,
:body
=>
body
,
:timeout
=>
30
pub
.
callback
{
sub_1
=
EventMachine
::
HttpRequest
.
new
(
nginx_address
+
'/sub/'
+
channel
.
to_s
+
'/'
+
channel_broad1
+
'/'
+
channel_broad2
+
'/'
+
channel_broad3
).
get
:head
=>
headers
,
:timeout
=>
60
sub_1
.
stream
{
|
chunk
|
sub_1
.
callback
{
|
chunk
|
assert_equal
(
403
,
sub_1
.
response_header
.
status
,
"Subscriber was not forbidden"
)
sub_2
=
EventMachine
::
HttpRequest
.
new
(
nginx_address
+
'/sub/'
+
channel
.
to_s
+
'/'
+
channel_broad1
+
'/'
+
channel_broad2
).
get
:head
=>
headers
,
:timeout
=>
60
sub_2
.
stream
{
|
chunk
|
EventMachine
.
stop
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment