aboutsummaryrefslogtreecommitdiffstats
path: root/tests/integration/lfs_view_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'tests/integration/lfs_view_test.go')
-rw-r--r--tests/integration/lfs_view_test.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/integration/lfs_view_test.go b/tests/integration/lfs_view_test.go
index 64ffebaa78..c26ece22be 100644
--- a/tests/integration/lfs_view_test.go
+++ b/tests/integration/lfs_view_test.go
@@ -68,14 +68,15 @@ func TestLFSRender(t *testing.T) {
req := NewRequest(t, "GET", "/user2/lfs/src/branch/master/crypt.bin")
resp := session.MakeRequest(t, req, http.StatusOK)
- doc := NewHTMLParser(t, resp.Body).doc
+ doc := NewHTMLParser(t, resp.Body)
fileInfo := doc.Find("div.file-info-entry").First().Text()
assert.Contains(t, fileInfo, "LFS")
- rawLink, exists := doc.Find("div.file-view > div.view-raw > a").Attr("href")
- assert.True(t, exists, "Download link should render instead of content because this is a binary file")
- assert.Equal(t, "/user2/lfs/media/branch/master/crypt.bin", rawLink, "The download link should use the proper /media link because it's in LFS")
+ // find new file view container
+ fileViewContainer := doc.Find("[data-global-init=initRepoFileView]")
+ assert.Equal(t, "/user2/lfs/media/branch/master/crypt.bin", fileViewContainer.AttrOr("data-raw-file-link", ""))
+ AssertHTMLElement(t, doc, ".view-raw > .file-view-render-container > .file-view-raw-prompt", 1)
})
// check that a directory with a README file shows its text