Like many, you have confused the class vs instance scopes.
class CommentsControllerTest < ActionController::TestCase
# in class scope
context "x" do
setup do
# in instance scope
# @response and friends are available
end
# back in class scope
end
end
In your case, you want to wrap the logger call at lines 22-23 in a
should:
class CommentsControllerTest < ActionController::TestCase
context "successful POST attempt" do
setup do
my_response = self.successful_post("xml")
Rails.logger "my_response: #{my_response.body}"
end
should "report the response" do
Rails.logger "@response: #{@response.body}"
end
end
end
Hope that helps.
--
François Beausoleil
http://blog.teksol.info/
http://piston.rubyforge.org/