mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-07 14:05:52 +01:00
Small fix for #147
This commit is contained in:
@@ -3,14 +3,14 @@ package service
|
|||||||
import org.specs2.mutable.Specification
|
import org.specs2.mutable.Specification
|
||||||
import java.util.Date
|
import java.util.Date
|
||||||
|
|
||||||
class AccountServiceSpec extends Specification with SpecBase {
|
class AccountServiceServiceSpec extends Specification with ServiceSpecBase {
|
||||||
|
|
||||||
"AccountService" should {
|
"AccountService" should {
|
||||||
val RootMailAddress = "root@localhost"
|
val RootMailAddress = "root@localhost"
|
||||||
|
|
||||||
"getAllUsers" in { withTestDB{
|
"getAllUsers" in { withTestDB{
|
||||||
AccountService.getAllUsers must be like{
|
AccountService.getAllUsers must be like{
|
||||||
case List(model.Account("root", RootMailAddress, _, true, _, _, _, None, None, false)) => ok
|
case List(model.Account("root", "root", RootMailAddress, _, true, _, _, _, None, None, false)) => ok
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
|
||||||
@@ -7,7 +7,7 @@ import org.apache.commons.io.FileUtils
|
|||||||
import scala.util.Random
|
import scala.util.Random
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
trait SpecBase {
|
trait ServiceSpecBase {
|
||||||
|
|
||||||
def withTestDB[A](action: => A): A = {
|
def withTestDB[A](action: => A): A = {
|
||||||
util.FileUtil.withTmpDir(new File(FileUtils.getTempDirectory(), Random.alphanumeric.take(10).mkString)){
|
util.FileUtil.withTmpDir(new File(FileUtils.getTempDirectory(), Random.alphanumeric.take(10).mkString)){
|
||||||
Reference in New Issue
Block a user