blob: a6ae2bdaa7a9d59936fdaefc3fb6715de05019b4 [file] [log] [blame]
package myapp
import grails.test.mixin.integration.Integration
import org.grails.datastore.gorm.GormEnhancer
import org.grails.gorm.graphql.plugin.testing.GraphQLSpec
import org.grails.orm.hibernate.HibernateDatastore
@Integration
class FooIntegrationSpec implements GraphQLSpec {
void "test a foo can be created"() {
when:
def resp = graphQL.graphql("""
mutation {
fooCreate(foo: {name: "x"}) {
id
errors {
field
message
}
}
}
""")
Map obj = resp.body().data.fooCreate
then:
obj.id == 1
GormEnhancer.findStaticApi(Foo).datastore instanceof HibernateDatastore
}
}