【发布时间】:2015-07-12 04:45:16
【问题描述】:
供参考:How make tests always run in same order in Scalatest?
我计划通过调用控制器/路由并将响应与预期的响应进行比较来测试我的应用程序。
我不想模拟我的持久层,所以我也可以测试它。我现在的方法是执行测试以反映用户操作。示例:
Test 1: User registers
--> Test 2: (depends on a existing user) User creates profile
--> Test 3: (depends on a user with existing profile) User changes profile
所以为了节省时间,我不想为测试 2 和测试 3 模拟任何东西,而是一直在同一个数据库上工作,并使用前面测试生成的数据。
这种方法可以吗?如何在 Specs2 或 ScalaTest 中指定执行顺序?
【问题讨论】:
标签: scala bdd playframework-2.3 scalatest specs2