aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/application/rake
diff options
context:
space:
mode:
authorScott Bronson <brons_git@rinspin.com>2016-02-07 14:21:40 -0800
committerScott Bronson <brons_git@rinspin.com>2016-02-07 14:32:43 -0800
commitba2aea98079fb50a2c210001deb16ab84fac3b41 (patch)
tree457dcf4e13b9b03b9603ac402041617fc41ef35b /railties/test/application/rake
parent8526e9bed21a119266e886c3316d3fe10c9af5ce (diff)
downloadrails-ba2aea98079fb50a2c210001deb16ab84fac3b41.tar.gz
rails-ba2aea98079fb50a2c210001deb16ab84fac3b41.tar.bz2
rails-ba2aea98079fb50a2c210001deb16ab84fac3b41.zip
revert dev:cache to rake task, fixes #23410
Diffstat (limited to 'railties/test/application/rake')
-rw-r--r--railties/test/application/rake/dev_test.rb34
1 files changed, 34 insertions, 0 deletions
diff --git a/railties/test/application/rake/dev_test.rb b/railties/test/application/rake/dev_test.rb
new file mode 100644
index 0000000000..43d7a5e156
--- /dev/null
+++ b/railties/test/application/rake/dev_test.rb
@@ -0,0 +1,34 @@
+require 'isolation/abstract_unit'
+
+module ApplicationTests
+ module RakeTests
+ class RakeDevTest < ActiveSupport::TestCase
+ include ActiveSupport::Testing::Isolation
+
+ def setup
+ build_app
+ end
+
+ def teardown
+ teardown_app
+ end
+
+ test 'dev:cache creates file and outputs message' do
+ Dir.chdir(app_path) do
+ output = `rake dev:cache`
+ assert File.exist?('tmp/caching-dev.txt')
+ assert_match(/Development mode is now being cached/, output)
+ end
+ end
+
+ test 'dev:cache deletes file and outputs message' do
+ Dir.chdir(app_path) do
+ `rails dev:cache` # Create caching file.
+ output = `rails dev:cache` # Delete caching file.
+ assert_not File.exist?('tmp/caching-dev.txt')
+ assert_match(/Development mode is no longer being cached/, output)
+ end
+ end
+ end
+ end
+end