0
@@ -38,6 +38,66 @@ class CachingTest < ActionController::IntegrationTest
0
+ def test_should_only_expire_overview_when_creating_draft
0
+ writer = login_as :quentin
0
+ visit_sections_and_feeds_with visitor
0
+ assert_caches_page overview_path do
0
+ visitor.get_with_basic 'admin/overview.xml', :login => :quentin
0
+ assert_difference Article, :count do
0
+ assert_expires_page overview_path do
0
+ writer.create :title => 'This is a new article & title', :body => 'this is a new article body', :draft => 0
0
+ assert_cached section_url_for(:home)
0
+ assert_cached feed_url_for(:home)
0
+ assert_cached section_url_for(:about)
0
+ assert_cached feed_url_for(:about)
0
+ def test_should_only_expire_overview_when_revising_draft
0
+ writer = login_as :quentin
0
+ visit_sections_and_feeds_with visitor
0
+ assert_caches_page overview_path do
0
+ visitor.get_with_basic 'admin/overview.xml', :login => :quentin
0
+ assert_expires_page overview_path do
0
+ writer.revise contents(:draft), :title => 'This is a new article & title', :draft => 0
0
+ assert_cached section_url_for(:home)
0
+ assert_cached feed_url_for(:home)
0
+ assert_cached section_url_for(:about)
0
+ assert_cached feed_url_for(:about)
0
+ def test_should_expire_sections_when_publishing_draft
0
+ writer = login_as :quentin
0
+ visit_sections_and_feeds_with visitor
0
+ assert_caches_page overview_path do
0
+ visitor.get_with_basic 'admin/overview.xml', :login => :quentin
0
+ assert_expires_page overview_path, section_url_for(:home), feed_url_for(:home) do
0
+ writer.revise contents(:draft), :title => 'This is a new article & title', :draft => 1, :published_at => 5.minutes.ago
0
+ assert_cached section_url_for(:about)
0
+ assert_cached feed_url_for(:about)
0
def test_should_expire_articles_after_editing
0
writer = login_as :quentin
0
@@ -245,11 +305,10 @@ class CachingTest < ActionController::IntegrationTest
0
writer = login_as :quentin
0
visit_sections_and_feeds_with visitor
0
- assert_expires_pages feed_url_for(:about)
do
0
+ assert_expires_pages feed_url_for(:about)
, section_url_for(:about) do
0
writer.revise contents(:site_map), 'sitemap whoo'
0
- assert_cached section_url_for(:about) # paged section only shows the homepage
0
assert_cached section_url_for(:home)
0
assert_cached feed_url_for(:home)
Comments
No one has commented yet.