Permalink
Browse files

Handle case where website has nothing to test

  • Loading branch information...
1 parent 5044ba9 commit 6e5c88defd591e1f0c8db2ed8d3d3606e5ef0e24 @alexanderteinum alexanderteinum committed Apr 8, 2013
Showing with 8 additions and 0 deletions.
  1. +4 −0 frontend/index.html
  2. +4 −0 frontend/views/test.coffee
View
4 frontend/index.html
@@ -155,6 +155,10 @@
<p class="lead">Could not find <%= webPage %>.</p>
</script>
+ <script type="text/template" id="test-nothing-to-test">
+ <p class="lead">There is nothing to test for <%= webPage %>.</p>
+ </script>
+
<script type="text/template" id="test-case-template">
<p class="lead"><%= question %></p>
<p>
View
4 frontend/views/test.coffee
@@ -24,6 +24,10 @@ define ['jquery', 'underscore', 'backbone'], ($, _, Backbone) ->
this.$el.html(
_.template($('#test-loading').html(), { 'webPage': this.model.get('webPage') })
)
+ else if this.model.getCurrentTest() == undefined
+ this.$el.html(
+ _.template($('#test-nothing-to-test').html(), { 'webPage': this.model.get('webPage') })
+ )
else
test = this.model.getCurrentTest()

0 comments on commit 6e5c88d

Please sign in to comment.