Permalink
Browse files

Get rid of unhelpful stubbing

This makes refactoring the controller code hard.
  • Loading branch information...
1 parent 8acc7a1 commit d1f0567e2bdffaab8dbdcfafde3128361e5b8032 @tekin tekin committed with heathd Jan 20, 2015
Showing with 3 additions and 7 deletions.
  1. +3 −7 test/functional/topics_controller_test.rb
@@ -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
@@ -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}")

0 comments on commit d1f0567

Please sign in to comment.