aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib
diff options
context:
space:
mode:
authorVladimir Dementyev <dementiev.vm@gmail.com>2019-01-13 22:53:46 -0500
committerVladimir Dementyev <dementiev.vm@gmail.com>2019-01-13 22:56:12 -0500
commitfc95836f8776b708ac30e4f1b83cc2a3cddfa77d (patch)
treefe7f54ce5a0c05afd70b5252dd3aaab9f2543068 /railties/lib
parent0f41aa30d30afff051e68afe67c53b626d5b05c0 (diff)
downloadrails-fc95836f8776b708ac30e4f1b83cc2a3cddfa77d.tar.gz
rails-fc95836f8776b708ac30e4f1b83cc2a3cddfa77d.tar.bz2
rails-fc95836f8776b708ac30e4f1b83cc2a3cddfa77d.zip
Add connection_test to app generator
Diffstat (limited to 'railties/lib')
-rw-r--r--railties/lib/rails/generators/rails/app/app_generator.rb2
-rw-r--r--railties/lib/rails/generators/rails/app/templates/test/channels/application_cable/connection_test.rb.tt13
2 files changed, 15 insertions, 0 deletions
diff --git a/railties/lib/rails/generators/rails/app/app_generator.rb b/railties/lib/rails/generators/rails/app/app_generator.rb
index 33002790d4..e777590be8 100644
--- a/railties/lib/rails/generators/rails/app/app_generator.rb
+++ b/railties/lib/rails/generators/rails/app/app_generator.rb
@@ -213,6 +213,7 @@ module Rails
empty_directory_with_keep_file "test/helpers"
empty_directory_with_keep_file "test/integration"
+ template "test/channels/application_cable/connection_test.rb"
template "test/test_helper.rb"
end
@@ -440,6 +441,7 @@ module Rails
if options[:skip_action_cable]
remove_dir "app/javascript/channels"
remove_dir "app/channels"
+ remove_dir "test/channels"
end
end
diff --git a/railties/lib/rails/generators/rails/app/templates/test/channels/application_cable/connection_test.rb.tt b/railties/lib/rails/generators/rails/app/templates/test/channels/application_cable/connection_test.rb.tt
new file mode 100644
index 0000000000..cc8337fc6d
--- /dev/null
+++ b/railties/lib/rails/generators/rails/app/templates/test/channels/application_cable/connection_test.rb.tt
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+require "test_helper"
+
+class ApplicationCable::ConnectionTest < ActionCable::Connection::TestCase
+ # test "connects with cookies" do
+ # cookies.signed[:user_id] = 42
+ #
+ # connect
+ #
+ # assert_equal connection.user_id, "42"
+ # end
+end