From c967225dcf5f1520244cb337e0871a40cb870541 Mon Sep 17 00:00:00 2001 From: futurechimp Date: Thu, 9 Jun 2011 13:28:00 +0100 Subject: [PATCH] Some more context. --- test/app/controllers/wires_controller_test.rb | 30 ++++++++++++++----- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/test/app/controllers/wires_controller_test.rb b/test/app/controllers/wires_controller_test.rb index b2c32b9..1c34dc2 100644 --- a/test/app/controllers/wires_controller_test.rb +++ b/test/app/controllers/wires_controller_test.rb @@ -13,15 +13,31 @@ class WiresControllerTest < Test::Unit::TestCase end context "show action" do - setup do - @wire = Wire.make - @wire.save - get "/wires/show/#{@wire.id}" + context "when the @wire has no feed_items" do + setup do + @wire = Wire.make + @wire.save + get "/wires/show/#{@wire.id}" + end + + should "work" do + puts last_request.params + assert last_response.ok? + end end - should "work" do - puts last_request.params - assert last_response.ok? + context "when the @wire has feed_items" do + setup do + @wire = Factory.make_wire + @feed_items = @wire.feed_items + get "/wires/show/#{@wire.id}" + end + + should "work" do + puts last_request.params + assert last_response.ok? + end + end end end