Changeset 896


Ignore:
Timestamp:
Apr 22, 2011, 1:14:08 PM (9 years ago)
Author:
gav
Message:

Domain change, rename PurchaseOrder.comment to singular, set maxSize constraint and init with blank string.

Location:
branches/features/purchaseOrders
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/features/purchaseOrders/grails-app/domain/PurchaseOrder.groovy

    r892 r896  
    33    Supplier supplier
    44
    5     String comments
     5    String comment = ""
    66    Date ordered
    77
     
    1111
    1212    static constraints = {
    13         comments(nullable:true)
     13        comment(maxSize:255)
    1414        ordered(nullable:true)
    1515    }
  • branches/features/purchaseOrders/test/unit/PurchaseOrderServiceTests.groovy

    r894 r896  
    5555        def po = pos.getOrCreatePurchaseOrder(params)
    5656
    57         assertThat po.comments, equalTo("Created by test")
     57        assertThat po.comment, equalTo("Created by test")
    5858        assertThat po.purchaseOrderNumber.value, equalTo("P1001")
    5959    }
     
    6767        def po = pos.getOrCreatePurchaseOrder(params)
    6868
    69         assertThat po.comments, equalTo(null)
     69        assertThat po.comment, equalTo("")
    7070        assertThat po.purchaseOrderNumber.value, equalTo("P1003")
    7171    }
     
    8787    def createPurchaseOrders(int howMany) {
    8888        for (int i=0; i<howMany; i++) {
    89             def po = new PurchaseOrder(comments:"Created by test", supplier:new Supplier())
     89            def po = new PurchaseOrder(comment:"Created by test", supplier:new Supplier())
    9090            def pon = PurchaseOrderNumber.list()[i]
    9191            pon.purchaseOrder = po;
Note: See TracChangeset for help on using the changeset viewer.