Created
May 2, 2011 17:18
-
-
Save kiy0taka/951946 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import grails.plugin.geb.GebSpec | |
| import geb.Page | |
| import spock.lang.Shared | |
| class PersonEditSpec extends GebSpec { | |
| @Shared fixtureLoader | |
| def 'きれいなURLで編集画面を開く'() { | |
| given: | |
| def fixtures = fixtureLoader.load { | |
| person(Person, name:'kiy0taka') | |
| } | |
| when: | |
| to PersonEditPage, fixtures.person.id | |
| then: | |
| at PersonEditPage | |
| driver.currentUrl == baseUrl + 'person/edit/' + fixtures.person.id | |
| } | |
| def 'クエリ文字列で編集画面を開く'() { | |
| given: | |
| def fixtures = fixtureLoader.load { | |
| person(Person, name:'kiy0taka') | |
| } | |
| when: | |
| to PersonEditPage, id:fixtures.person.id | |
| then: | |
| at PersonEditPage | |
| driver.currentUrl == baseUrl + 'person/edit?id=' + fixtures.person.id | |
| } | |
| } | |
| class PersonEditPage extends Page { | |
| static url = 'person/edit' | |
| static at = { title == 'Edit Person' } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment