diff options
Diffstat (limited to 'actioncable/test/javascript/src')
-rw-r--r-- | actioncable/test/javascript/src/unit/action_cable_test.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/actioncable/test/javascript/src/unit/action_cable_test.js b/actioncable/test/javascript/src/unit/action_cable_test.js index 83426fa32e..c46f9878d2 100644 --- a/actioncable/test/javascript/src/unit/action_cable_test.js +++ b/actioncable/test/javascript/src/unit/action_cable_test.js @@ -41,5 +41,17 @@ module("ActionCable", () => { assert.equal(consumer.url, testURL) }) + + 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` + assert.equal(consumer.url, `${testURL}foo`) + }) }) }) |