【发布时间】:2014-04-17 16:48:33
【问题描述】:
所以,我正在为使用 ember-simple-auth gem 进行登录身份验证的 Ember 应用程序编写 Qunit 测试(以 teaspoon 作为测试运行器),我的测试如下(咖啡脚本):
#= require qunit_spec_helper
test "Employee signs in", ->
expect(1)
visit("/login").then(->
fillIn "input.email", "employee1@example.com"
).then(->
fillIn "input.user_password", "password1"
).then(->
click "button.btn-primary"
).andThen ->
equal(find('h2').length,1, "Welcome to the App")
这里是测试助手:
QUnit.testStart ->
Ember.run ->
App.reset()
Ember.testing = true
App.setupForTesting()
App.injectTestHelpers()
QUnit.testDone ->
Ember.testing = false
QUnit.done ->
Ember.run ->
App.reset()
当我运行测试时(密切关注控制台),我收到以下错误:
POST http://localhost:3000/teaspoon/qunit/oauth/token 404 (Not Found)
我似乎无法登录,无论如何.. 我的想法用完了,非常感谢任何帮助/建议:)
【问题讨论】:
标签: javascript testing ember.js qunit teaspoon