From 916536fc849a4dac347064175389900d3b936e41 Mon Sep 17 00:00:00 2001 From: Ian White Date: Wed, 30 Apr 2008 15:50:15 +0100 Subject: [PATCH] Fixed target edge specs --- lib/ardes/response_for.rb | 6 +++--- spec/controllers/inline_xml_foo_controller_spec.rb | 6 ------ spec/controllers/xml_foo_controller_spec.rb | 8 -------- 3 files changed, 3 insertions(+), 17 deletions(-) diff --git a/lib/ardes/response_for.rb b/lib/ardes/response_for.rb index aa4f966..14ad105 100644 --- a/lib/ardes/response_for.rb +++ b/lib/ardes/response_for.rb @@ -137,13 +137,13 @@ def respond_to_with_response_for(*types, &block) return respond_to_without_response_for(*types, &block) if options[:exclusive] || @running_before_filters respond_to_without_response_for do |responder| + if action_blocks = self.class.send(:action_responses)[action_name] + action_blocks.reverse.each {|b| instance_exec(responder, &b)} + end unless self.class.send(:respond_to_replaced)[action_name] types.each {|type| responder.send(type)} block.call(responder) if block end - if action_blocks = self.class.send(:action_responses)[action_name] - action_blocks.each {|b| instance_exec(responder, &b)} - end end ensure @performed_respond_to = true diff --git a/spec/controllers/inline_xml_foo_controller_spec.rb b/spec/controllers/inline_xml_foo_controller_spec.rb index 16f3a1c..512ef02 100644 --- a/spec/controllers/inline_xml_foo_controller_spec.rb +++ b/spec/controllers/inline_xml_foo_controller_spec.rb @@ -6,12 +6,6 @@ controller.stub!(:xml_call).and_return('XML') end - it "get :foo should render text/html 'foo'" do - get :foo - response.should render_template(:foo) - response.content_type.should == 'text/html' - end - it "get :foo should assign @foo" do get :foo assigns[:foo].should == 'Foo' diff --git a/spec/controllers/xml_foo_controller_spec.rb b/spec/controllers/xml_foo_controller_spec.rb index e2e3724..3b69a6a 100644 --- a/spec/controllers/xml_foo_controller_spec.rb +++ b/spec/controllers/xml_foo_controller_spec.rb @@ -28,12 +28,4 @@ response.should render_template(:bar) response.content_type.should == 'application/xml' end - - it "get :just_a_template, :format => 'xml' should render just_a_template" do - @controller.stub!(:template_exists?).and_return(true) - @controller.stub!(:template_public?).and_return(true) - get :just_a_template, :format => 'xml' - response.should render_template(:just_a_template) - response.content_type.should == 'application/xml' - end end \ No newline at end of file