Merge branch 'master' into pr-add-account-webhook

This commit is contained in:
Naoki Takezoe
2017-06-18 18:15:41 +09:00
committed by GitHub
125 changed files with 2849 additions and 1041 deletions

View File

@@ -29,7 +29,7 @@ class GitBucketCoreModuleSpec extends FunSuite {
}
test("Migration MySQL", ExternalDBTest){
val config = aMysqldConfig(v5_7_10)
val config = aMysqldConfig(v5_7_latest)
.withPort(3306)
.withUser("sa", "sa")
.withCharset(Charset.UTF8)

View File

@@ -62,6 +62,7 @@ trait ServiceSpecBase {
content = None,
assignedUserName = None,
milestoneId = None,
priorityId = None,
isPullRequest = true)
}

View File

@@ -1,5 +1,6 @@
package gitbucket.core.view
import java.text.SimpleDateFormat
import java.util.Date
import gitbucket.core.model.Account
@@ -34,18 +35,22 @@ class AvatarImageProviderSpec extends FunSpec with MockitoSugar {
it("should show uploaded image even if gravatar integration is enabled") {
implicit val context = Context(createSystemSettings(true), None, request)
val provider = new AvatarImageProviderImpl(Some(createAccount(Some("icon.png"))))
val account = createAccount((Some("icon.png")))
val date = new SimpleDateFormat("yyyyMMddHHmmss").format(account.updatedDate)
val provider = new AvatarImageProviderImpl(Some(account))
assert(provider.toHtml("user", 32).toString ==
"<img src=\"/user/_avatar\" class=\"avatar\" style=\"width: 32px; height: 32px;\" />")
s"""<img src="/user/_avatar?${date}" class="avatar" style="width: 32px; height: 32px;" />""")
}
it("should show local image for no image account if gravatar integration is disabled") {
implicit val context = Context(createSystemSettings(false), None, request)
val provider = new AvatarImageProviderImpl(Some(createAccount(None)))
val account = createAccount(None)
val date = new SimpleDateFormat("yyyyMMddHHmmss").format(account.updatedDate)
val provider = new AvatarImageProviderImpl(Some(account))
assert(provider.toHtml("user", 32).toString ==
"<img src=\"/user/_avatar\" class=\"avatar\" style=\"width: 32px; height: 32px;\" />")
s"""<img src="/user/_avatar?${date}" class="avatar" style="width: 32px; height: 32px;" />""")
}
it("should show Gravatar image for specified mail address if gravatar integration is enabled") {