Permalink
Browse files

test for GRAILS-9119

  • Loading branch information...
1 parent 7fb216e commit abdde44044baa83d92334a1e3e519d1e4a6dec58 @graemerocher graemerocher committed May 21, 2012
View
35 ...ls-test-suite-uber/src/test/groovy/grails/test/mixin/AddToAndServiceInjectionTests.groovy
@@ -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.