get diary_rss_path
assert_select "rss>channel>item", :count => 2
- with_diary_feed_delay(6) do
+ with_settings(:diary_feed_delay => 6) do
get diary_rss_path
assert_select "rss>channel>item", :count => 1
end
assert_template :show
# Try a non-integer ID
- assert_raise ActionController::RoutingError do
- get "/user/#{CGI.escape(user.display_name)}/diary/#{diary_entry.id})"
- end
+ get "/user/#{CGI.escape(user.display_name)}/diary/#{diary_entry.id})"
+ assert_response :not_found
+ assert_template "rescues/routing_error"
# Try a deleted entry
diary_entry_deleted = create(:diary_entry, :user => user, :visible => false)
assert_select "a[href=?]", "/user/#{ERB::Util.u(entry.user.display_name)}/diary/#{entry.id}"
end
end
-
- def with_diary_feed_delay(value)
- diary_feed_delay = Settings.diary_feed_delay
- Settings.diary_feed_delay = value
-
- yield
-
- Settings.diary_feed_delay = diary_feed_delay
- end
end