action-cable-testing 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +7 -8
- data/lib/action_cable/connection/test_case.rb +3 -1
- data/lib/action_cable/testing/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 764d0e009091268cdcd8894568fd3a0228f3dae9cbfd77940209a9ffe1deb573
|
4
|
+
data.tar.gz: 6fadaa17e4e76c952c5e47e5dc6602cd4ec2b3bf2ce88df897ded52f3c5ed48e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc7b8f670f821059a7c6fc8ea7eacf7360bfc3eab60cf0f7651c3d5b04b0406d77395b62b3c4dbe3b091c426cfd57292e998ee4c79672ae24fe372fb8485c597
|
7
|
+
data.tar.gz: 3dff7864524e0c04a22e608afb74548280957669f3c3d26d1411ae02f01204f2ce46061add68073c1f331d438b0a2a5740b0d6f37b2e94c1ae17286497451382
|
data/README.md
CHANGED
@@ -173,11 +173,12 @@ module ApplicationCable
|
|
173
173
|
|
174
174
|
# Asserts that the connection identifier is correct
|
175
175
|
assert_equal "John", connection.user.name
|
176
|
-
|
176
|
+
end
|
177
177
|
|
178
|
-
|
179
|
-
|
180
|
-
|
178
|
+
def test_does_not_connect_without_user
|
179
|
+
assert_reject_connection do
|
180
|
+
connect
|
181
|
+
end
|
181
182
|
end
|
182
183
|
end
|
183
184
|
end
|
@@ -281,6 +282,8 @@ RSpec.describe ApplicationCable::Connection, type: :channel do
|
|
281
282
|
end
|
282
283
|
```
|
283
284
|
|
285
|
+
**NOTE:** for connections testing you must use `type: :channel` too.
|
286
|
+
|
284
287
|
#### Shared contexts to switch between adapters
|
285
288
|
|
286
289
|
Sometimes you may want to use _real_ Action Cable adapter instead of the test one (for example, in Capybara-like tests).
|
@@ -336,10 +339,6 @@ rails generate test_unit:channel chat
|
|
336
339
|
rails generate rspec:channel chat
|
337
340
|
```
|
338
341
|
|
339
|
-
## TODO
|
340
|
-
|
341
|
-
- [Connection unit-testing](https://github.com/palkan/action-cable-testing/issues)
|
342
|
-
|
343
342
|
## Development
|
344
343
|
|
345
344
|
After checking out the repo, run `bundle install` to install dependencies. Then, run `bundle exec rake` to run the tests.
|
@@ -55,7 +55,9 @@ module ActionCable
|
|
55
55
|
attr_reader :logger, :request
|
56
56
|
|
57
57
|
def initialize(path, cookies, headers)
|
58
|
-
|
58
|
+
inner_logger = ActiveSupport::Logger.new(StringIO.new)
|
59
|
+
tagged_logging = ActiveSupport::TaggedLogging.new(inner_logger)
|
60
|
+
@logger = ActionCable::Connection::TaggedLoggerProxy.new(tagged_logging, tags: [])
|
59
61
|
|
60
62
|
uri = URI.parse(path)
|
61
63
|
env = {
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: action-cable-testing
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vladimir Dementyev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-04-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actioncable
|