aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2024-11-12 13:41:22 +0800
committerGitHub <noreply@github.com>2024-11-12 05:41:22 +0000
commit160ccb5ee2c9dce7e59fa2635c8539e0338d83ee (patch)
treedac43606793ae68d9a29e80509ffcb638cf8d3ea /tests
parent4c924bf43cdc944c6ce34cce54f216c455a346a2 (diff)
downloadgitea-160ccb5ee2c9dce7e59fa2635c8539e0338d83ee.tar.gz
gitea-160ccb5ee2c9dce7e59fa2635c8539e0338d83ee.zip
Fix test fixtures for user2/lfs.git (#32477)
Diffstat (limited to 'tests')
-rw-r--r--tests/gitea-repositories-meta/user2/lfs.git/objects/30/77e1c4c8964613df72c37d14275c1eda5228a92
-rw-r--r--tests/gitea-repositories-meta/user2/lfs.git/objects/6b/bc79965141058b0026f2064dfb6d2eae3c4540bin259 -> 0 bytes
-rw-r--r--tests/gitea-repositories-meta/user2/lfs.git/objects/b0/89e97ee59224e8c5676673c096ee4b6a8b9342bin123 -> 0 bytes
-rw-r--r--tests/gitea-repositories-meta/user2/lfs.git/objects/e9/c32647bab825977942598c0efa415de300304bbin170 -> 0 bytes
-rw-r--r--tests/gitea-repositories-meta/user2/lfs.git/refs/heads/master2
-rw-r--r--tests/integration/lfs_view_test.go17
6 files changed, 13 insertions, 8 deletions
diff --git a/tests/gitea-repositories-meta/user2/lfs.git/objects/30/77e1c4c8964613df72c37d14275c1eda5228a9 b/tests/gitea-repositories-meta/user2/lfs.git/objects/30/77e1c4c8964613df72c37d14275c1eda5228a9
deleted file mode 100644
index c2dc6e5a4f..0000000000
--- a/tests/gitea-repositories-meta/user2/lfs.git/objects/30/77e1c4c8964613df72c37d14275c1eda5228a9
+++ /dev/null
@@ -1,2 +0,0 @@
-xKÊÉOR0´0`pö÷ òt
- ñôs×ËMQHËÌ)I-²ÍI+VHÉLK3rS‹ÒSÁ,Ý’ÔŠ.-½¬‚t"U&eæ¥23¯,1'“8ûØæAÅ \ No newline at end of file
diff --git a/tests/gitea-repositories-meta/user2/lfs.git/objects/6b/bc79965141058b0026f2064dfb6d2eae3c4540 b/tests/gitea-repositories-meta/user2/lfs.git/objects/6b/bc79965141058b0026f2064dfb6d2eae3c4540
deleted file mode 100644
index 97455cbc46..0000000000
--- a/tests/gitea-repositories-meta/user2/lfs.git/objects/6b/bc79965141058b0026f2064dfb6d2eae3c4540
+++ /dev/null
Binary files differ
diff --git a/tests/gitea-repositories-meta/user2/lfs.git/objects/b0/89e97ee59224e8c5676673c096ee4b6a8b9342 b/tests/gitea-repositories-meta/user2/lfs.git/objects/b0/89e97ee59224e8c5676673c096ee4b6a8b9342
deleted file mode 100644
index 33ab64e730..0000000000
--- a/tests/gitea-repositories-meta/user2/lfs.git/objects/b0/89e97ee59224e8c5676673c096ee4b6a8b9342
+++ /dev/null
Binary files differ
diff --git a/tests/gitea-repositories-meta/user2/lfs.git/objects/e9/c32647bab825977942598c0efa415de300304b b/tests/gitea-repositories-meta/user2/lfs.git/objects/e9/c32647bab825977942598c0efa415de300304b
deleted file mode 100644
index f513e2a308..0000000000
--- a/tests/gitea-repositories-meta/user2/lfs.git/objects/e9/c32647bab825977942598c0efa415de300304b
+++ /dev/null
Binary files differ
diff --git a/tests/gitea-repositories-meta/user2/lfs.git/refs/heads/master b/tests/gitea-repositories-meta/user2/lfs.git/refs/heads/master
index 487a433af2..8832a3e857 100644
--- a/tests/gitea-repositories-meta/user2/lfs.git/refs/heads/master
+++ b/tests/gitea-repositories-meta/user2/lfs.git/refs/heads/master
@@ -1 +1 @@
-e9c32647bab825977942598c0efa415de300304b
+73cf03db6ece34e12bf91e8853dc58f678f2f82d
diff --git a/tests/integration/lfs_view_test.go b/tests/integration/lfs_view_test.go
index 05770e5e0a..a0e004ed58 100644
--- a/tests/integration/lfs_view_test.go
+++ b/tests/integration/lfs_view_test.go
@@ -10,6 +10,8 @@ import (
"strings"
"testing"
+ "code.gitea.io/gitea/models/db"
+ "code.gitea.io/gitea/models/git"
repo_model "code.gitea.io/gitea/models/repo"
"code.gitea.io/gitea/models/unittest"
user_model "code.gitea.io/gitea/models/user"
@@ -94,13 +96,18 @@ func TestLFSRender(t *testing.T) {
t.Run("Invalid", func(t *testing.T) {
defer tests.PrintCurrentTest(t)()
- req := NewRequest(t, "GET", "/user2/lfs/src/branch/master/invalid")
+ // the LFS exists
+ req := NewRequest(t, "GET", "/user2/lfs/src/branch/master/CONTRIBUTING.md")
resp := session.MakeRequest(t, req, http.StatusOK)
+ content := NewHTMLParser(t, resp.Body).Find("div.file-view").Text()
+ assert.Contains(t, content, "Testing documents in LFS")
- doc := NewHTMLParser(t, resp.Body).doc
-
- content := doc.Find("div.file-view").Text()
- assert.Contains(t, content, "oid sha256:9d178b5f15046343fd32f451df93acc2bdd9e6373be478b968e4cad6b6647351")
+ // then make it disappear
+ assert.NoError(t, db.TruncateBeans(db.DefaultContext, &git.LFSMetaObject{}))
+ req = NewRequest(t, "GET", "/user2/lfs/src/branch/master/CONTRIBUTING.md")
+ resp = session.MakeRequest(t, req, http.StatusOK)
+ content = NewHTMLParser(t, resp.Body).Find("div.file-view").Text()
+ assert.Contains(t, content, "oid sha256:7b6b2c88dba9f760a1a58469b67fee2b698ef7e9399c4ca4f34a14ccbe39f623")
})
}