Commits

John Chandler  committed c7777fd

Added additional Twill tests

  • Participants
  • Parent commits 818a970

Comments (0)

Files changed (1)

File fluidocalypse/tests/twill_tests/functional_tests.twill

 go http://127.0.0.1:8000/search/genre/
 code 200
 
-# test without trailing list
+# test without trailing slash
 go http://127.0.0.1:8000/search/genre
 code 200
 
 find '<select name="genre">'
 find '<option value="grindcore">Grindcore</option>'
 find '</select>'
-find '<input type="submit" value="Show genre" />'
+find '<input type="submit" value="Show genre" />'
+
+# ############################################################
+# test calls to genre pages
+# ############################################################
+
+# test missing genre
+go http://127.0.0.1:8000/genre/progressive_vegetarian_grindcore/
+code 404
+
+# test with trailing slash
+go http://127.0.0.1:8000/genre/jazz/
+code 200
+
+# test without trailing slash
+go http://127.0.0.1:8000/genre/jazz
+code 200
+
+# check page contents
+find '<h2 class="heading">Jazz</h2>'
+find '<div id="related_bands">'
+find '<li><a href="/band/Frank%20Zappa">Frank Zappa</a></li>'
+
+find '<div id="related_genres">'
+find '<h3 class="heading">Related Genres</h3>'
+find '<span style="font-size: [.0-9]+em; white-space: nowrap; padding: [.0-9]+em;"><a href="/genre/avant_garde_music">Avant-garde music</a></span>'
+