aboutsummaryrefslogtreecommitdiffstats
path: root/actioncable/test/stubs/user.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actioncable/test/stubs/user.rb')
-rw-r--r--actioncable/test/stubs/user.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/actioncable/test/stubs/user.rb b/actioncable/test/stubs/user.rb
new file mode 100644
index 0000000000..a66b4f87d5
--- /dev/null
+++ b/actioncable/test/stubs/user.rb
@@ -0,0 +1,15 @@
+class User
+ attr_reader :name
+
+ def initialize(name)
+ @name = name
+ end
+
+ def to_global_id
+ GlobalID.new("User##{name}")
+ end
+
+ def to_gid_param
+ to_global_id.to_param
+ end
+end