action-cable-testing 0.0.7 → 0.1.0
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 +14 -2
- data/lib/action_cable/testing.rb +0 -2
- data/lib/action_cable/testing/rspec.rb +2 -0
- data/lib/action_cable/testing/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ccc828bc776db7a157df36234b2ff0d6c7071464
|
|
4
|
+
data.tar.gz: ff68ff540546c5a70fcafa6a63287f28829544a1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 00db28832cc067f02a0f98a3651e5d3a20a28aa394802bdd1d5bee2645f573cc9e7d0aa79b8466ad708b3480b3462949f380e2dc5dafdfb1c22a82524956a969
|
|
7
|
+
data.tar.gz: 39e3ad0bbe0f6a54b3c06177c78924cbc023f5fba35ef39bf933e835a1880b7b13e17dfb000e14e7886c6aaa64f715d5ef27c4471a6b25ef1c1b1d8f21716a29
|
data/README.md
CHANGED
|
@@ -124,8 +124,15 @@ end
|
|
|
124
124
|
|
|
125
125
|
### RSpec Usage
|
|
126
126
|
|
|
127
|
+
First, you need to have [rspec-rails](https://github.com/rspec/rspec-rails) installed.
|
|
127
128
|
|
|
128
|
-
|
|
129
|
+
Second, add this to your `"rails_helper.rb"` after requiring `environment.rb`:
|
|
130
|
+
|
|
131
|
+
```ruby
|
|
132
|
+
require "action_cable/testing/rspec"
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
To use `have_broadcasted_to` / `broadcast_to` matchers anywhere in your specs, set your adapter to `test` in `cable.yml`:
|
|
129
136
|
|
|
130
137
|
```yml
|
|
131
138
|
# config/cable.yml
|
|
@@ -133,7 +140,8 @@ test:
|
|
|
133
140
|
adapter: test
|
|
134
141
|
```
|
|
135
142
|
|
|
136
|
-
|
|
143
|
+
And then use these matchers, for example:
|
|
144
|
+
|
|
137
145
|
|
|
138
146
|
```ruby
|
|
139
147
|
RSpec.describe CommentsController do
|
|
@@ -186,6 +194,10 @@ rails generate test_unit:channel chat
|
|
|
186
194
|
rails generate rspec:channel chat
|
|
187
195
|
```
|
|
188
196
|
|
|
197
|
+
## TODO
|
|
198
|
+
|
|
199
|
+
- [Connection unit-testing](https://github.com/palkan/action-cable-testing/issues)
|
|
200
|
+
|
|
189
201
|
## Development
|
|
190
202
|
|
|
191
203
|
After checking out the repo, run `bundle install` to install dependencies. Then, run `bundle exec rake` to run the tests.
|
data/lib/action_cable/testing.rb
CHANGED