test/test_serious.rb in serious-0.2.2 vs test/test_serious.rb in serious-0.2.3
- old
+ new
@@ -25,12 +25,16 @@
should_not_contain_text "The number is 4", "ul#articles li"
should_contain_text "Foo Bar", "ul#articles"
should_contain_text "Serious Test Blog", "head title"
- should_contain_elements 1, "ul.archives li"
+ should_contain_elements 1, "ul.archives:first li"
should_contain_text "Disco 2000", "ul.archives li:first"
+
+ should_contain_text "Pages", "h3"
+ should_contain_elements 2, "ul.archives:last li"
+ should_contain_text "About me", "ul.archives:last li:first"
end
# ===================================================================
# Tests for the Archives
# ===================================================================
@@ -131,10 +135,11 @@
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"
+ should_contain_elements 1, ".article span.author"
end
context "GET /2009/12/11/ruby-is-the-shit" do
setup { get '/2009/12/11/ruby-is-the-shit' }
@@ -202,10 +207,18 @@
setup { get '/2009/12/24/merry-christmas' }
should_contain_text "View the discussion thread.", "#container .article noscript"
should_contain_elements 1, "#container #disqus_thread"
end
+
+ context "GET /pages/about" do
+ setup { get '/pages/about' }
+
+ should_respond_with 200
+ should_set_cache_control_to 300
+ should_contain_elements 0, "#container #disqus_thread"
+ end
end
context "With disqus inactive" do
setup { Serious.set :disqus, false }
@@ -263,6 +276,41 @@
should_contain_attribute "href", "http://feeds.feedburner.com/myfeedurl", "head link:last"
end
end
+
+
+ # ===================================================================
+ # Tests for pages
+ # ===================================================================
+ context "GET /pages" do
+ setup { get '/pages' }
+ should_respond_with 200
+ should_set_cache_control_to 300
+
+ should_contain_elements 2, "ul.archives li"
+ should_contain_text "About me", "ul.archives li:first"
+ end
+
+ context "GET /pages/" do
+ setup { get '/pages/' }
+ should_respond_with 200
+ end if 1 == 2
+
+ context "GET /pages/about" do
+ setup { get '/pages/about' }
+
+ should_respond_with 200
+ should_set_cache_control_to 300
+
+ should_contain_text "About me", "#container .article h2"
+ should_contain_text "Some text about me", "#container .article .body"
+ should_contain_elements 0, ".article span.author"
+ should_contain_text "And some more content with erb", "#container .article .body"
+ end
+
+ context "GET /pages/about/" do
+ setup { get '/pages/about/' }
+ should_respond_with 200
+ end if 1 == 2 # TODO: FIXME
end