Skip to content

Commit

Permalink
test for GRAILS-9119
Browse files Browse the repository at this point in the history
  • Loading branch information
graemerocher committed May 21, 2012
1 parent 7fb216e commit abdde44
Showing 1 changed file with 35 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package grails.test.mixin

import spock.lang.Specification
import grails.persistence.Entity
import org.junit.Test
import org.junit.Ignore

/**
*/

@TestFor(Ship)
@Mock(Pirate)
class AddToAndServiceInjectionTests {

@Test
@Ignore // TODO: remove when upgrading to datastore 1.0.9
void testAddTo() {
def pirate = new Pirate(name: 'Billy')
def ship = new Ship()
ship.addToPirates(pirate)
assert 1 == ship.pirates.size()
}
}

@Entity
class Pirate {
String name
def pirateShipService
}


@Entity
class Ship {
static hasMany = [pirates: Pirate]
}

0 comments on commit abdde44

Please sign in to comment.