Skip to content

Adding base classes for Spock. You can now write functional test cases u...#2

Open
saurabh-agrawal83 wants to merge 3 commits intogpc:masterfrom
saurabh-agrawal83:master
Open

Adding base classes for Spock. You can now write functional test cases u...#2
saurabh-agrawal83 wants to merge 3 commits intogpc:masterfrom
saurabh-agrawal83:master

Conversation

@saurabh-agrawal83
Copy link

Writing functional test cases using Spock. Added APIFunctionalSpec base class..

@saurabh-agrawal83
Copy link
Author

It would be nice if we could write functional test cases using Spock. For ex:

 class TestSpec extends APIFunctionalSpec {

void "api testing"() {

    when:
    get('/mycontroller') {
        headers['X-something-special'] = 'A-value-here'
        // NOTE: you can use this "method call" approach or assignment x = y
        userName "marc"
        email "marc@somewhere.com"
    }

    then:
    assertContentContains "it worked"
}

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant