From 7ad35284aeee32f07f9712b145e9ca30b86f8f44 Mon Sep 17 00:00:00 2001 From: Nick Sutterer Date: Tue, 6 Mar 2012 09:25:53 +0100 Subject: [PATCH] moving controller into responder_test namespace. --- test/responder_test.rb | 41 ++++++++++++++++++++--------------------- test/test_helper.rb | 2 ++ 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/test/responder_test.rb b/test/responder_test.rb index ec24e42..0d79f09 100644 --- a/test/responder_test.rb +++ b/test/responder_test.rb @@ -1,28 +1,27 @@ require 'test_helper' -Singer = Struct.new(:name) -class SingersController < ActionController::Base - include Roar::Rails::ControllerAdditions - respond_to :json - - def explicit_representer - singer = Musician.new("Bumi") - respond_with singer, :with_representer => SingerRepresenter - end - - def implicit_representer - singer = Singer.new("Bumi") - respond_with singer - end - - def collection_of_representers - singers = [Singer.new("Bumi"), Singer.new("Bjork"), Singer.new("Sinead")] - respond_with singers - end -end - class ResponderTest < ActionController::TestCase include Roar::Rails::TestCase + + class SingersController < ActionController::Base + include Roar::Rails::ControllerAdditions + respond_to :json + + def explicit_representer + singer = Musician.new("Bumi") + respond_with singer, :with_representer => SingerRepresenter + end + + def implicit_representer + singer = Singer.new("Bumi") + respond_with singer + end + + def collection_of_representers + singers = [Singer.new("Bumi"), Singer.new("Bjork"), Singer.new("Sinead")] + respond_with singers + end + end tests SingersController diff --git a/test/test_helper.rb b/test/test_helper.rb index ac82e59..74c1e7a 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -8,3 +8,5 @@ require "dummy/config/environment" require "rails/test_help" # adds stuff like @routes, etc. require "roar/rails/test_case" + +Singer = Struct.new(:name)