From a1ba2625bfc9e8f753b37f2a350c59243ceb3413 Mon Sep 17 00:00:00 2001 From: Christoph Haas Date: Mon, 17 Apr 2017 00:02:23 +0200 Subject: [PATCH] Fixed deprecation warnings --- config/environments/test.rb | 9 +++------ test/controllers/admin_controller_test.rb | 19 +++++++++++++++++++ test/controllers/my_controller_test.rb | 14 ++++++++++++++ 3 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 test/controllers/admin_controller_test.rb create mode 100644 test/controllers/my_controller_test.rb diff --git a/config/environments/test.rb b/config/environments/test.rb index 4f154be..a7ee23c 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -12,15 +12,12 @@ Debshots::Application.configure do # preloads Rails for running tests, you may have to set it to true. config.eager_load = false - # ActiveRecord errors propagate normally (forward deprecation to Rails 5) - config.active_record.raise_in_transactional_callbacks = true - # Test :sorted or :random. ":random" may be safer but harder to debug. config.active_support.test_order = :sorted # Configure static asset server for tests with Cache-Control for performance. - config.serve_static_files = true - config.static_cache_control = "public, max-age=3600" + config.public_file_server.enabled = true + config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' } # Show full error reports and disable caching. config.consider_all_requests_local = true @@ -57,5 +54,5 @@ Debshots::Application.configure do config.image_sizes = { large: '800x600', small: '160x120', - } + } end diff --git a/test/controllers/admin_controller_test.rb b/test/controllers/admin_controller_test.rb new file mode 100644 index 0000000..8a8914c --- /dev/null +++ b/test/controllers/admin_controller_test.rb @@ -0,0 +1,19 @@ +require "test_helper" + +describe AdminController do + it "should get status" do + get admin_status_url + value(response).must_be :success? + end + + it "should get screenshots" do + get admin_screenshots_url + value(response).must_be :success? + end + + it "should get integration" do + get admin_integration_url + value(response).must_be :success? + end + +end diff --git a/test/controllers/my_controller_test.rb b/test/controllers/my_controller_test.rb new file mode 100644 index 0000000..c242a33 --- /dev/null +++ b/test/controllers/my_controller_test.rb @@ -0,0 +1,14 @@ +require "test_helper" + +describe MyController do + it "should get index" do + get my_index_url + value(response).must_be :success? + end + + it "should get uploads" do + get my_uploads_url + value(response).must_be :success? + end + +end