aboutsummaryrefslogtreecommitdiffstats
path: root/actioncable/test
diff options
context:
space:
mode:
authorrmacklin <1863540+rmacklin@users.noreply.github.com>2019-04-02 14:04:43 -0700
committerKasper Timm Hansen <kaspth@gmail.com>2019-04-02 23:04:43 +0200
commitd03177ffbccb5b30217448d526f1e9aa1fa24297 (patch)
treec5d9e71dc6126803f357d00f90944d19c37fb5c0 /actioncable/test
parent2c4dab11d1db468f54b409250f3c39ff555e8d50 (diff)
downloadrails-d03177ffbccb5b30217448d526f1e9aa1fa24297.tar.gz
rails-d03177ffbccb5b30217448d526f1e9aa1fa24297.tar.bz2
rails-d03177ffbccb5b30217448d526f1e9aa1fa24297.zip
Simplify ActionCable.createWebSocketURL and realphabetize exports (#35810)
* Remove unnecessary variable from ActionCable.createWebSocketURL * Improve ActionCable test by creating the Consumer before reassigning URL With this change, the test now actually verifies that the Consumer's url property changes dynamically (from testURL to `${testURL}foo`). * Fix alphabetization of ActionCable exports
Diffstat (limited to 'actioncable/test')
-rw-r--r--actioncable/test/javascript/src/unit/action_cable_test.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/actioncable/test/javascript/src/unit/action_cable_test.js b/actioncable/test/javascript/src/unit/action_cable_test.js
index 2181f955e3..c46f9878d2 100644
--- a/actioncable/test/javascript/src/unit/action_cable_test.js
+++ b/actioncable/test/javascript/src/unit/action_cable_test.js
@@ -42,14 +42,15 @@ module("ActionCable", () => {
assert.equal(consumer.url, testURL)
})
- test("uses function to generate URL", assert => {
+ test("dynamically computes URL from function", assert => {
let dynamicURL = testURL
const generateURL = () => {
return dynamicURL
}
+ const consumer = ActionCable.createConsumer(generateURL)
+ assert.equal(consumer.url, testURL)
dynamicURL = `${testURL}foo`
- const consumer = ActionCable.createConsumer(generateURL)
assert.equal(consumer.url, `${testURL}foo`)
})
})