Skip to content

Commit

Permalink
added functional tests;
Browse files Browse the repository at this point in the history
  • Loading branch information
Neha_Gupta committed Jul 9, 2015
1 parent fb6e83e commit 90decdd
Showing 1 changed file with 22 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,29 @@ import geb.spock.*
@Rollback
class CsvTestControllerSpec extends GebSpec {

def setup() {
}
def setup() {
}

def cleanup() {
}
def cleanup() {
}

void "canary test"() {
when:"The home page is visited"
go '/'
void "canary test"() {
when: "The home page is visited"
go '/'

then:"The title is correct"
$('title').text() == "Welcome to Grails"
}
then: "The title is correct"
$('title').text() == "Welcome to Grails"
}

void "test writeCsv"(){
when: "writeCsv action is visited"
go '/csvTest/writeCsv'

then:
driver.pageSource.contains("\"x\",\"y\"")
driver.pageSource.contains("\"1\",\"2\"")
driver.pageSource.contains("\"3\",\"4\"")
driver.pageSource.contains("\"5\",\"6\"")

}
}

0 comments on commit 90decdd

Please sign in to comment.