aboutsummaryrefslogtreecommitdiffstats
path: root/actioncable/test
diff options
context:
space:
mode:
Diffstat (limited to 'actioncable/test')
-rw-r--r--actioncable/test/javascript/src/unit/action_cable_test.js8
-rw-r--r--actioncable/test/test_helper.rb2
2 files changed, 8 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 c9d34abc6d..c46f9878d2 100644
--- a/actioncable/test/javascript/src/unit/action_cable_test.js
+++ b/actioncable/test/javascript/src/unit/action_cable_test.js
@@ -42,12 +42,16 @@ 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 testURL
+ return dynamicURL
}
const consumer = ActionCable.createConsumer(generateURL)
assert.equal(consumer.url, testURL)
+
+ dynamicURL = `${testURL}foo`
+ assert.equal(consumer.url, `${testURL}foo`)
})
})
})
diff --git a/actioncable/test/test_helper.rb b/actioncable/test/test_helper.rb
index c924f1e475..033f034b0c 100644
--- a/actioncable/test/test_helper.rb
+++ b/actioncable/test/test_helper.rb
@@ -41,3 +41,5 @@ class ActionCable::TestCase < ActiveSupport::TestCase
end
end
end
+
+require_relative "../../tools/test_common"