Skip to content

Commit

Permalink
Get rid of unhelpful stubbing
Browse files Browse the repository at this point in the history
This makes refactoring the controller code hard.
  • Loading branch information
tekin committed Feb 11, 2015
1 parent 2cb408e commit 6919525
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions test/functional/topics_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,8 @@ class TopicsControllerTest < ActionController::TestCase
end

view_test 'GET :show for atom feed has the right elements' do
topic = build(:topic, id: 1)
policy = create(:published_policy)
topic.stubs(:latest).returns([policy])
Topic.stubs(:find).returns(topic)
topic = create(:topic)
policy = create(:published_policy, topics: [topic])

get :show, id: topic, format: :atom

Expand All @@ -175,9 +173,7 @@ class TopicsControllerTest < ActionController::TestCase
end

test 'GET :show has a 5 minute expiry time' do
topic = build(:topic)
Topic.stubs(:find).returns(topic)

topic = create(:topic)
get :show, id: topic

assert_cache_control("max-age=#{5.minutes}")
Expand Down

0 comments on commit 6919525

Please sign in to comment.