File tree Expand file tree Collapse file tree 3 files changed +15
-15
lines changed Expand file tree Collapse file tree 3 files changed +15
-15
lines changed Original file line number Diff line number Diff line change 1
- * Add two new assertion methods for ActionCable test cases: ` assert_not_has_stream `
2
- and ` assert_not_has_stream_for ` . These methods can be used to assert that a
1
+ * Add two new assertion methods for ActionCable test cases: ` assert_has_no_stream `
2
+ and ` assert_has_no_stream_for ` . These methods can be used to assert that a
3
3
stream has been stopped, e.g. via ` stop_stream ` or ` stop_stream_for ` . They complement
4
4
the already existing ` assert_has_stream ` and ` assert_has_stream_for ` methods.
5
5
6
6
``` ruby
7
- assert_not_has_stream " messages"
8
- assert_not_has_stream_for User .find(42 )
7
+ assert_has_no_stream " messages"
8
+ assert_has_no_stream_for User .find(42 )
9
9
```
10
10
11
- * Sebastian P öll*
11
+ * Sebastian P öll* , * Junichi Sato *
12
12
13
13
Please check [7 - 1 - stable](https: // github.com/ rails/ rails/ blob/ 7 - 1 - stable/ actioncable/ CHANGELOG .md) for previous changes.
Original file line number Diff line number Diff line change @@ -314,24 +314,24 @@ def assert_has_stream_for(object)
314
314
315
315
# Asserts that the specified stream has not been started.
316
316
#
317
- # def test_assert_not_started_stream
317
+ # def test_assert_no_started_stream
318
318
# subscribe
319
- # assert_not_has_stream 'messages'
319
+ # assert_has_no_stream 'messages'
320
320
# end
321
321
#
322
- def assert_not_has_stream ( stream )
322
+ def assert_has_no_stream ( stream )
323
323
assert subscription . streams . exclude? ( stream ) , "Stream #{ stream } has been started"
324
324
end
325
325
326
326
# Asserts that the specified stream for a model has not started.
327
327
#
328
- # def test_assert_not_started_stream_for
328
+ # def test_assert_no_started_stream_for
329
329
# subscribe id: 41
330
- # assert_not_has_stream_for User.find(42)
330
+ # assert_has_no_stream_for User.find(42)
331
331
# end
332
332
#
333
- def assert_not_has_stream_for ( object )
334
- assert_not_has_stream ( broadcasting_for ( object ) )
333
+ def assert_has_no_stream_for ( object )
334
+ assert_has_no_stream ( broadcasting_for ( object ) )
335
335
end
336
336
337
337
private
Original file line number Diff line number Diff line change @@ -111,14 +111,14 @@ def test_not_stream_without_params
111
111
subscribe
112
112
unsubscribe
113
113
114
- assert_not_has_stream "test_0"
114
+ assert_has_no_stream "test_0"
115
115
end
116
116
117
117
def test_not_stream_with_params
118
118
subscribe id : 42
119
119
perform :unsubscribed , id : 42
120
120
121
- assert_not_has_stream "test_42"
121
+ assert_has_no_stream "test_42"
122
122
end
123
123
124
124
def test_unsubscribe_from_stream
@@ -150,7 +150,7 @@ def test_not_stream_with_params
150
150
subscribe id : 42
151
151
perform :unsubscribed , id : 42
152
152
153
- assert_not_has_stream_for User . new ( 42 )
153
+ assert_has_no_stream_for User . new ( 42 )
154
154
end
155
155
end
156
156
You can’t perform that action at this time.
0 commit comments