Changeset 502 for trunk/test


Ignore:
Timestamp:
May 31, 2010, 1:53:03 PM (10 years ago)
Author:
roberth
Message:

RELTIME fields in the wizard now show the parsed text in blue when leaving the input field.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/dbnp/studycapturing/WizardControllerTests.groovy

    r496 r502  
    1212    }
    1313
    14     void testSomething() {
     14    void testAjaxParseRelTimeNonExistent() {
     15        // Without parameters, the method should give an error
     16        controller.ajaxParseRelTime();
     17        assert controller.response.status == 400;
     18    }
    1519
     20    void testAjaxParseRelTimeEmpty() {
     21        // With empty parameter, the method should work
     22        controller.params.reltime = '';
     23        controller.ajaxParseRelTime();
     24        assert controller.response.status == 200
     25        assert controller.response.contentAsString == ""
    1626    }
     27
     28    void testAjaxParseRelTimeCorrect() {
     29        // With simple parameter, the method should work
     30        controller.params.reltime = '3d';
     31        controller.ajaxParseRelTime();
     32        assert controller.response.status == 200
     33        assert controller.response.contentAsString == "3 days"
     34    }
     35
     36    void testAjaxParseRelTimeIllegal() {
     37        // With illegal parameter, the method should give status code 400
     38        controller.params.reltime = 'no valid reltime';
     39        controller.ajaxParseRelTime();
     40        assert controller.response.status == 400;
     41    }
     42
    1743}
Note: See TracChangeset for help on using the changeset viewer.