mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-23 22:27:38 -05:00
Change date of the files in test to serve the static file and not generate a new one
This commit is contained in:
parent
705cd16dee
commit
da794a866e
1 changed files with 6 additions and 0 deletions
|
@ -3,8 +3,10 @@ package markdown
|
||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/http/httptest"
|
"net/http/httptest"
|
||||||
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/mholt/caddy/middleware"
|
"github.com/mholt/caddy/middleware"
|
||||||
"github.com/russross/blackfriday"
|
"github.com/russross/blackfriday"
|
||||||
|
@ -139,6 +141,10 @@ func getTrue() bool {
|
||||||
t.Fatalf("Could not create HTTP request: %v", err)
|
t.Fatalf("Could not create HTTP request: %v", err)
|
||||||
}
|
}
|
||||||
rec = httptest.NewRecorder()
|
rec = httptest.NewRecorder()
|
||||||
|
currenttime := time.Now().Local().Add(-time.Second)
|
||||||
|
err = os.Chtimes("testdata/og/first.md", currenttime, currenttime)
|
||||||
|
currenttime = time.Now().Local()
|
||||||
|
err = os.Chtimes("testdata/og_static/og/first.md/index.html", currenttime, currenttime)
|
||||||
|
|
||||||
md.ServeHTTP(rec, req)
|
md.ServeHTTP(rec, req)
|
||||||
if rec.Code != http.StatusOK {
|
if rec.Code != http.StatusOK {
|
||||||
|
|
Loading…
Reference in a new issue