I have the following code in my integration test.
module 'Admin page when logged in',
setup: ->
App.ApplicationAdapter = DS.FixtureAdapter
signIn()
visit "/admin"
teardown: ->
signOut()
App.reset()
test "new button click", ->
click("a.new-place")
andThen ->
equal(find('h1').text(), 'New Place')
I have done the setup of the test helpers appropriately hence I do have access to the visit and click helpers. However the click helper doesn't actually trigger the click or the transition to the appropriate route is not made. Putting a debugger, shows that the ".new-place" link does exist. Even trying with the following syntax doesn't work.
test "new button click", ->
click("a.new-place").then ->
equal(find("h1").text(), "New Place")
Am I missing something here? Thanks for the help.
Aucun commentaire:
Enregistrer un commentaire