Created
February 11, 2015 14:07
-
-
Save kdabrowski/437d276f1c3589215144 to your computer and use it in GitHub Desktop.
This file contains 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 Ember from 'ember'` | |
`import startApp from '../../helpers/start-app'` | |
`import stub from '../../helpers/api-stub'` | |
App = null | |
server = null | |
module "Acceptance: InboxShow", | |
setup: -> | |
App = startApp() | |
server = stub.create() | |
authenticateSession() | |
visit '/' | |
teardown = -> | |
Ember.run App, "destroy" | |
server.shutdown() | |
goToMail = -> | |
click ".mail-list-item:first" | |
addRequest = -> | |
click ".js-add-selected-request-popover" | |
searchRequest = (text) -> | |
fillIn ".popover-content .search", text | |
findPopover = -> | |
find (".popover-request") | |
findDetail = -> | |
find ("#msg-details") | |
matchFirstResult = (text) -> | |
equal find(".recent-requests-wrap tr:first").first().text(), text | |
matchFirstResultSelected = (text) -> | |
equal find(".selected tr:first").first().text(), text | |
popoverClose = -> | |
click ".close" | |
test "Shows message details popup", -> | |
goToMail() | |
equal findDetail().length, 1 | |
test "Shows add request popover", -> | |
goToMail() | |
addRequest() | |
andThen -> | |
equal findPopover().length, 1 | |
test "Colses message details popup", -> | |
goToMail() | |
popoverClose() | |
andThen -> | |
equal findPopover().length, 0 | |
test "Search test", -> | |
goToMail() | |
addRequest() | |
andThen -> | |
equal findPopover().length, 1 | |
andThen -> | |
#searchRequest("C Contact #5") | |
fillIn ".popover-content .search", "C Contact #5" | |
andThen -> | |
matchFirstResult("#129/01/2015") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment