From a5554e0d9f425afc3dd7242aa6941830e9b7fd2d Mon Sep 17 00:00:00 2001 From: Benjamin Fleischer Date: Fri, 12 Jun 2015 10:54:57 -0500 Subject: [PATCH] Use a different controller in different tests A number of test were defining and using the same controller MyController = Class.new(ActionController::Base) which was causing some state to leak across tests. --- test/action_controller/adapter_selector_test.rb | 4 ++-- test/action_controller/explicit_serializer_test.rb | 4 ++-- test/action_controller/json_api_linked_test.rb | 4 ++-- test/action_controller/rescue_from_test.rb | 4 ++-- test/action_controller/serialization_test.rb | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/test/action_controller/adapter_selector_test.rb b/test/action_controller/adapter_selector_test.rb index ce90daf8..88c0ce6b 100644 --- a/test/action_controller/adapter_selector_test.rb +++ b/test/action_controller/adapter_selector_test.rb @@ -3,7 +3,7 @@ require 'test_helper' module ActionController module Serialization class AdapterSelectorTest < ActionController::TestCase - class MyController < ActionController::Base + class AdapterSelectorTestController < ActionController::Base def render_using_default_adapter @profile = Profile.new({ name: 'Name 1', description: 'Description 1', comments: 'Comments 1' }) render json: @profile @@ -20,7 +20,7 @@ module ActionController end end - tests MyController + tests AdapterSelectorTestController def test_render_using_default_adapter get :render_using_default_adapter diff --git a/test/action_controller/explicit_serializer_test.rb b/test/action_controller/explicit_serializer_test.rb index 5fafafa5..35138cf4 100644 --- a/test/action_controller/explicit_serializer_test.rb +++ b/test/action_controller/explicit_serializer_test.rb @@ -3,7 +3,7 @@ require 'test_helper' module ActionController module Serialization class ExplicitSerializerTest < ActionController::TestCase - class MyController < ActionController::Base + class ExplicitSerializerTestController < ActionController::Base def render_using_explicit_serializer @profile = Profile.new(name: 'Name 1', description: 'Description 1', @@ -65,7 +65,7 @@ module ActionController end end - tests MyController + tests ExplicitSerializerTestController def test_render_using_explicit_serializer get :render_using_explicit_serializer diff --git a/test/action_controller/json_api_linked_test.rb b/test/action_controller/json_api_linked_test.rb index 559b2dd9..dab35c56 100644 --- a/test/action_controller/json_api_linked_test.rb +++ b/test/action_controller/json_api_linked_test.rb @@ -3,7 +3,7 @@ require 'test_helper' module ActionController module Serialization class JsonApiLinkedTest < ActionController::TestCase - class MyController < ActionController::Base + class JsonApiLinkedTestController < ActionController::Base def setup_post ActionController::Base.cache_store.clear @role1 = Role.new(id: 1, name: 'admin') @@ -78,7 +78,7 @@ module ActionController end end - tests MyController + tests JsonApiLinkedTestController def test_render_resource_without_include get :render_resource_without_include diff --git a/test/action_controller/rescue_from_test.rb b/test/action_controller/rescue_from_test.rb index d52ea8e6..82689178 100644 --- a/test/action_controller/rescue_from_test.rb +++ b/test/action_controller/rescue_from_test.rb @@ -3,7 +3,7 @@ require 'test_helper' module ActionController module Serialization class RescueFromTest < ActionController::TestCase - class MyController < ActionController::Base + class RescueFromTestController < ActionController::Base rescue_from Exception, with: :handle_error def render_using_raise_error_serializer @@ -16,7 +16,7 @@ module ActionController end end - tests MyController + tests RescueFromTestController def test_rescue_from get :render_using_raise_error_serializer diff --git a/test/action_controller/serialization_test.rb b/test/action_controller/serialization_test.rb index 240ba93c..ff646a97 100644 --- a/test/action_controller/serialization_test.rb +++ b/test/action_controller/serialization_test.rb @@ -3,7 +3,7 @@ require 'test_helper' module ActionController module Serialization class ImplicitSerializerTest < ActionController::TestCase - class MyController < ActionController::Base + class ImplicitSerializationTestController < ActionController::Base def render_using_implicit_serializer @profile = Profile.new({ name: 'Name 1', description: 'Description 1', comments: 'Comments 1' }) render json: @profile @@ -152,7 +152,7 @@ module ActionController end end - tests MyController + tests ImplicitSerializationTestController # We just have Null for now, this will change def test_render_using_implicit_serializer