Skip to content

Commit

Permalink
A little more Feeds controller view testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
futurechimp committed Jun 4, 2011
1 parent 4030eae commit a9514f2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions admin/controllers/feeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
end

get :edit, :with => :id do
@wires = Wire.all
@feed = Feed.find(params[:id])
render 'feeds/edit'
end
Expand Down
8 changes: 8 additions & 0 deletions test/app/controllers/admin/feeds_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class Admin::FeedsControllerTest < Test::Unit::TestCase
context "on GET to new" do
setup do
@wire = Wire.make
@wire.save
get '/admin/feeds/new'
end

Expand All @@ -39,6 +40,8 @@ class Admin::FeedsControllerTest < Test::Unit::TestCase

context "on GET to edit" do
setup do
@wire = Wire.make
@wire.save
@feed = Factory.make_stubbed_feed
@feed.save
get "/admin/feeds/edit/#{@feed.id}"
Expand All @@ -48,6 +51,11 @@ class Admin::FeedsControllerTest < Test::Unit::TestCase
assert last_response.ok?
assert_match /#{@feed.url}/, last_response.body
end

should "insert the @wire name into the body" do
assert last_response.body.include?(@wire.name)
end

end

# context "on POST to notify" do
Expand Down

0 comments on commit a9514f2

Please sign in to comment.