From d03177ffbccb5b30217448d526f1e9aa1fa24297 Mon Sep 17 00:00:00 2001 From: rmacklin <1863540+rmacklin@users.noreply.github.com> Date: Tue, 2 Apr 2019 14:04:43 -0700 Subject: 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 --- actioncable/test/javascript/src/unit/action_cable_test.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'actioncable/test/javascript/src/unit/action_cable_test.js') 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`) }) }) -- cgit v1.2.3