user2493154
user2493154

Reputation: 41

Grails Integration Test Maps

I want to write an integration test, that tests the response of a controller, that only returns a map. Normally for unit tests, this is done as follows

def model = controller.showBookDetails()
assert model.author == 'Alvin Plantinga'

In the integration test this does not work for me. Is there another method?

Greetings

Upvotes: 0

Views: 48

Answers (1)

Alidad
Alidad

Reputation: 5538

Try something like this :

 MyController controller = new MyController()
 def model = controller.showBookDetails()
 assert model.author == 'Alvin Plantinga'

Upvotes: 1

Related Questions