palkan / action-cable-testing

Action Cable testing utils
MIT License
213 stars 17 forks source link

multiple connections testing #40

Closed namiwang closed 5 years ago

namiwang commented 5 years ago

Hey guys, we're trying to implement some multi-user multi-connection testings and have got no luck by far.

We could always stub_connection multiple times, but we haven't found any options to assign different connection to subscribe.

Any advice?

palkan commented 5 years ago

Looks like you're describing the integration test.

This gem provides unit-testing utilities, i.e. allows you to test your connection/channel/broadcasting logic in isolation.

For multi-client communication you should use system tests (i.e. browser based). Another option is to use real web socket clients in test (you can try https://github.com/palkan/wsdirector, for example)