test/test_serious.rb in serious-0.1.2 vs test/test_serious.rb in serious-0.1.3
- old
+ new
@@ -7,10 +7,11 @@
# ===================================================================
context "GET /" do
setup { get '/' }
should_respond_with 200
+ should_set_cache_control_to 300
should_contain_text "Serious Test Blog", "#header h1 a"
should_contain_elements 3, "ul#articles li"
should_contain_text "Merry Christmas!", "ul#articles li:first"
@@ -33,10 +34,11 @@
# ===================================================================
context "GET /2009" do
setup { get '/2009' }
should_respond_with 200
+ should_set_cache_control_to 300
should_contain_text "Archives for 2009", "#container h2:first"
should_contain_elements 3, "ul.archives li"
should_contain_text "Merry Christmas!", "ul.archives li:first"
should_contain_text "Ruby is the shit!", "ul.archives"
should_contain_text "Foo Bar", "ul.archives"
@@ -44,64 +46,71 @@
context "GET /2009/12" do
setup { get '/2009/12' }
should_respond_with 200
+ should_set_cache_control_to 300
should_contain_text "Archives for 2009-12", "#container h2:first"
should_contain_elements 2, "ul.archives li"
should_contain_text "Merry Christmas!", "ul.archives li:first"
should_contain_text "Ruby is the shit!", "ul.archives"
end
context "GET /2009/12/11" do
setup { get '/2009/12/11' }
should_respond_with 200
+ should_set_cache_control_to 300
should_contain_text "Archives for 2009-12-11", "#container h2:first"
should_contain_elements 1, "ul.archives li"
should_contain_text "Ruby is the shit!", "ul.archives li:first"
end
context "GET /2000/" do
setup { get '/2000' }
should_respond_with 200
+ should_set_cache_control_to 300
should_contain_text "Archives for 2000", "#container h2:first"
should_contain_elements 1, "ul.archives li"
should_contain_text "Disco 2000", "ul.archives li:first"
end
context "GET /2005/" do
setup { get '/2005' }
should_respond_with 200
+ should_set_cache_control_to 300
should_contain_text "Archives for 2005", "#container h2:first"
should_contain_elements 0, "ul.archives li"
end
context "GET /2000/1" do
setup { get '/2000/1' }
should_respond_with 200
+ should_set_cache_control_to 300
should_contain_text "Archives for 2000-01", "#container h2:first"
should_contain_elements 1, "ul.archives li"
should_contain_text "Disco 2000", "ul.archives li:first"
end
context "GET /2000/1/01" do
setup { get '/2000/1/01' }
should_respond_with 200
+ should_set_cache_control_to 300
should_contain_text "Archives for 2000-01-01", "#container h2:first"
should_contain_elements 1, "ul.archives li"
should_contain_text "Disco 2000", "ul.archives li:first"
end
context "GET /archives" do
setup { get '/archives' }
should_respond_with 200
+ should_set_cache_control_to 300
should_contain_text "Archives", "#container h2:first"
should_contain_elements 4, "ul.archives li"
should_contain_text "Merry Christmas!", "ul.archives li:first"
should_contain_text "Ruby is the shit!", "ul.archives"
should_contain_text "Foo Bar", "ul.archives"
@@ -114,40 +123,44 @@
context "GET /2009/12/24/merry-christmas" do
setup { get '/2009/12/24/merry-christmas' }
should_respond_with 200
+ should_set_cache_control_to 300
should_contain_text "Merry Christmas!", "#container h2:first"
should_contain_text "Merry Christmas! - Serious Test Blog", "head title"
should_contain_text "Merry christmas, dear reader!", ".article .body"
should_contain_text "Lorem ipsum dolor...", ".article .body"
end
context "GET /2009/12/11/ruby-is-the-shit" do
setup { get '/2009/12/11/ruby-is-the-shit' }
should_respond_with 200
+ should_set_cache_control_to 300
should_contain_text "Ruby is the shit!", "#container h2:first"
should_contain_text "Some kind of introduction and summary", ".article .body"
# Erb should evaluate properly
should_contain_text "The number is 4", ".article .body"
end
context "GET /2000/1/1/disco-2000" do
setup { get '/2000/1/1/disco-2000' }
should_respond_with 200
+ should_set_cache_control_to 300
should_contain_text "Disco 2000", "#container h2:first"
should_contain_text "Well we were born within one hour of each other.", ".article .body"
# Markdown should evaluate properly
should_contain_text "by Pulp", ".article .body h3:first"
end
context "GET /2009/1/1/disco-2000" do
setup { get '/2009/1/1/disco-2000' }
should_respond_with 404
+ should_set_cache_control_to 300
should_contain_text "The requested page could not be found!", "#container h2:first"
should_not_contain_text "Well we were born within one hour of each other.", ".article .body"
end
# ===================================================================
@@ -159,7 +172,19 @@
end
context "GET /foobar.baz" do
setup { get '/foobar.baz' }
should_respond_with 404
+ end
+
+ # ===================================================================
+ # Tests for the atom feed
+ # ===================================================================
+ context "GET /atom.xml" do
+ setup { get '/atom.xml' }
+ should_respond_with 200
+ should_set_cache_control_to 300
+
+ should_contain_text "Merry Christmas!", "feed entry:first title"
+ should_contain_text "Christoph Olszowka", "feed entry:first author name:first"
end
end