mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-08 06:25:51 +01:00
Fix testcase
This commit is contained in:
@@ -3,10 +3,11 @@ package gitbucket.core.view
|
|||||||
import java.util.Date
|
import java.util.Date
|
||||||
|
|
||||||
import gitbucket.core.model.Account
|
import gitbucket.core.model.Account
|
||||||
import gitbucket.core.service.{SystemSettingsService, RequestCache}
|
import gitbucket.core.service.{RequestCache, SystemSettingsService}
|
||||||
import gitbucket.core.controller.Context
|
import gitbucket.core.controller.Context
|
||||||
import SystemSettingsService.SystemSettings
|
import SystemSettingsService.SystemSettings
|
||||||
import javax.servlet.http.HttpServletRequest
|
import javax.servlet.http.{HttpServletRequest, HttpSession}
|
||||||
|
|
||||||
import play.twirl.api.Html
|
import play.twirl.api.Html
|
||||||
import org.scalatest.FunSpec
|
import org.scalatest.FunSpec
|
||||||
import org.scalatest.mock.MockitoSugar
|
import org.scalatest.mock.MockitoSugar
|
||||||
@@ -16,9 +17,11 @@ import org.mockito.Mockito._
|
|||||||
class AvatarImageProviderSpec extends FunSpec with MockitoSugar {
|
class AvatarImageProviderSpec extends FunSpec with MockitoSugar {
|
||||||
|
|
||||||
val request = mock[HttpServletRequest]
|
val request = mock[HttpServletRequest]
|
||||||
|
val session = mock[HttpSession]
|
||||||
when(request.getRequestURL).thenReturn(new StringBuffer("http://localhost:8080/path.html"))
|
when(request.getRequestURL).thenReturn(new StringBuffer("http://localhost:8080/path.html"))
|
||||||
when(request.getRequestURI).thenReturn("/path.html")
|
when(request.getRequestURI).thenReturn("/path.html")
|
||||||
when(request.getContextPath).thenReturn("")
|
when(request.getContextPath).thenReturn("")
|
||||||
|
when(request.getSession).thenReturn(session)
|
||||||
|
|
||||||
describe("getAvatarImageHtml") {
|
describe("getAvatarImageHtml") {
|
||||||
it("should show Gravatar image for no image account if gravatar integration is enabled") {
|
it("should show Gravatar image for no image account if gravatar integration is enabled") {
|
||||||
|
|||||||
Reference in New Issue
Block a user