Skip to content

Commit

Permalink
OBPIH-633 fixed references to old requisition types (mostly in tests)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmiranda committed Oct 27, 2017
1 parent ded8bdc commit 2f3d89f
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion grails-app/views/requisitionTemplate/batch.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<div class="buttonBar">
<g:link class="button icon log" controller="requisitionTemplate" action="list"><warehouse:message code="default.list.label" args="[warehouse.message(code:'requisitionTemplates.label').toLowerCase()]"/></g:link>
<g:isUserAdmin>
<g:link class="button icon add" controller="requisitionTemplate" action="create" params="[type:'WARD_STOCK']"><warehouse:message code="default.add.label" args="[warehouse.message(code:'requisitionTemplate.label').toLowerCase()]"/></g:link>
<g:link class="button icon add" controller="requisitionTemplate" action="create" params="[type:'STOCK']"><warehouse:message code="default.add.label" args="[warehouse.message(code:'requisitionTemplate.label').toLowerCase()]"/></g:link>
</g:isUserAdmin>
</div>
--%>
Expand Down
2 changes: 1 addition & 1 deletion grails-app/views/requisitionTemplate/show.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<div class="buttonBar">
<g:link class="button icon log" controller="requisitionTemplate" action="list"><warehouse:message code="default.list.label" args="[warehouse.message(code:'requisitionTemplates.label').toLowerCase()]"/></g:link>
<g:isUserAdmin>
<g:link class="button icon add" controller="requisitionTemplate" action="create" params="[type:'WARD_STOCK']"><warehouse:message code="default.add.label" args="[warehouse.message(code:'requisitionTemplate.label').toLowerCase()]"/></g:link>
<g:link class="button icon add" controller="requisitionTemplate" action="create" params="[type:'STOCK']"><warehouse:message code="default.add.label" args="[warehouse.message(code:'requisitionTemplate.label').toLowerCase()]"/></g:link>
</g:isUserAdmin>
</div>
--%>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class RequisitionControllerIntegrationTests extends GroovyTestCase {
def requisition = new Requisition(
name:'testRequisition'+ UUID.randomUUID().toString()[0..5],
commodityClass: CommodityClass.MEDICATION,
type: RequisitionType.WARD_NON_STOCK,
type: RequisitionType.NON_STOCK,
origin: location,
destination: location,
requestedBy: person,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class RequisitionIntegrationTests extends GroovyTestCase {
def requisition = new Requisition(
name:'testRequisition'+ UUID.randomUUID().toString()[0..5],
commodityClass: CommodityClass.MEDICATION,
type: RequisitionType.WARD_NON_STOCK,
type: RequisitionType.NON_STOCK,
origin: location,
destination: location,
requestedBy: person,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,15 +180,15 @@ class RequisitionControllerTests extends ControllerUnitTestCase{
def today = new Date().format("MM/dd/yyyy")
//def tomorrow = new Date().plus(1).format("MM/dd/yyyy")
controller.session.warehouse = location1
controller.params.type = "WARD_STOCK"
controller.params.type = "STOCK"
controller.create()
assert renderArgs.view == "edit"
assert renderArgs.model
assert renderArgs.model.locations == [location1]
assert renderArgs.model.requisition
def requisition = renderArgs.model.requisition
assert requisition.dateRequested.format("MM/dd/yyyy") == today
assert requisition.type == RequisitionType.WARD_STOCK
assert requisition.type == RequisitionType.STOCK
assert requisition.status == RequisitionStatus.CREATED
assert requisition.requestedDeliveryDate.format("MM/dd/yyyy") == today

Expand Down
22 changes: 11 additions & 11 deletions test/unit/org/pih/warehouse/requisition/RequisitionTests.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class RequisitionTests extends GrailsUnitTestCase {
def destination = new Location(name: "Boston")
def requestedBy = new User(username: "jmiranda")
def requisition = new Requisition(id: "1", origin: origin, destination: destination, requestedBy: requestedBy,
type: RequisitionType.DEPOT_TO_DEPOT, commodityClass: CommodityClass.MEDICATION,
type: RequisitionType.ADHOC, commodityClass: CommodityClass.MEDICATION,
dateRequested: new Date(), requestedDeliveryDate: new Date())

mockDomain(Requisition, [requisition])
Expand All @@ -69,7 +69,7 @@ class RequisitionTests extends GrailsUnitTestCase {
assertNotSame requisitionClone, requisition
assertEquals origin, requisitionClone.origin
assertEquals destination, requisitionClone.destination
assertEquals RequisitionType.DEPOT_TO_DEPOT, requisitionClone.type
assertEquals RequisitionType.ADHOC, requisitionClone.type
assertEquals CommodityClass.MEDICATION, requisitionClone.commodityClass
assertEquals new Date().clearTime(), requisitionClone.dateRequested.clearTime()
assertEquals new Date().clearTime(), requisitionClone.requestedDeliveryDate.clearTime()
Expand Down Expand Up @@ -166,17 +166,17 @@ class RequisitionTests extends GrailsUnitTestCase {
def requisition3 = new Requisition(id: "3", destination: boston, origin: miami, dateRequested: today)
def requisition4 = new Requisition(id: "4", destination: boston, origin: miami, dateRequested: tomorrow)

def requisition5 = new Requisition(id: "5", destination: boston, origin: miami, dateRequested: today, type: RequisitionType.WARD_STOCK, commodityClass: CommodityClass.CONSUMABLES, dateCreated: today)
def requisition6 = new Requisition(id: "6", destination: boston, origin: miami, dateRequested: today, type: RequisitionType.WARD_ADHOC, commodityClass: CommodityClass.CONSUMABLES, dateCreated: today)
def requisition7 = new Requisition(id: "7", destination: miami, origin: boston, dateRequested: today, type: RequisitionType.WARD_NON_STOCK, commodityClass: CommodityClass.CONSUMABLES, dateCreated: today)
def requisition5 = new Requisition(id: "5", destination: boston, origin: miami, dateRequested: today, type: RequisitionType.STOCK, commodityClass: CommodityClass.CONSUMABLES, dateCreated: today)
def requisition6 = new Requisition(id: "6", destination: boston, origin: miami, dateRequested: today, type: RequisitionType.ADHOC, commodityClass: CommodityClass.CONSUMABLES, dateCreated: today)
def requisition7 = new Requisition(id: "7", destination: miami, origin: boston, dateRequested: today, type: RequisitionType.NON_STOCK, commodityClass: CommodityClass.CONSUMABLES, dateCreated: today)

def requisition8 = new Requisition(id: "8", destination: miami, origin: boston, dateRequested: tomorrow, type: RequisitionType.WARD_NON_STOCK, commodityClass: CommodityClass.MEDICATION, dateCreated: today)
def requisition9 = new Requisition(id: "9", destination: miami, origin: boston, dateRequested: tomorrow, type: RequisitionType.WARD_NON_STOCK, commodityClass: CommodityClass.CONSUMABLES, dateCreated: today)
def requisition10 = new Requisition(id: "10", destination: miami, origin: boston, dateRequested: tomorrow, type: RequisitionType.WARD_NON_STOCK, commodityClass: CommodityClass.MEDICATION, dateCreated: today)
def requisition8 = new Requisition(id: "8", destination: miami, origin: boston, dateRequested: tomorrow, type: RequisitionType.NON_STOCK, commodityClass: CommodityClass.MEDICATION, dateCreated: today)
def requisition9 = new Requisition(id: "9", destination: miami, origin: boston, dateRequested: tomorrow, type: RequisitionType.NON_STOCK, commodityClass: CommodityClass.CONSUMABLES, dateCreated: today)
def requisition10 = new Requisition(id: "10", destination: miami, origin: boston, dateRequested: tomorrow, type: RequisitionType.NON_STOCK, commodityClass: CommodityClass.MEDICATION, dateCreated: today)

def requisition11 = new Requisition(id: "11", destination: miami, origin: boston, dateRequested: tomorrow, type: RequisitionType.WARD_NON_STOCK, dateCreated: tomorrow)
def requisition12 = new Requisition(id: "12", destination: miami, origin: boston, dateRequested: tomorrow, type: RequisitionType.WARD_NON_STOCK,dateCreated: yesterday)
def requisition13 = new Requisition(id: "13", destination: miami, origin: boston, dateRequested: tomorrow, type: RequisitionType.WARD_NON_STOCK, dateCreated: today)
def requisition11 = new Requisition(id: "11", destination: miami, origin: boston, dateRequested: tomorrow, type: RequisitionType.NON_STOCK, dateCreated: tomorrow)
def requisition12 = new Requisition(id: "12", destination: miami, origin: boston, dateRequested: tomorrow, type: RequisitionType.NON_STOCK,dateCreated: yesterday)
def requisition13 = new Requisition(id: "13", destination: miami, origin: boston, dateRequested: tomorrow, type: RequisitionType.NON_STOCK, dateCreated: today)

// def equal1 = 0,
def firstWins = 1 //, secondWins = -1
Expand Down

0 comments on commit 2f3d89f

Please sign in to comment.