summaryrefslogtreecommitdiffstats
path: root/models/repo_test.go
diff options
context:
space:
mode:
authorBo-Yi Wu <appleboy.tw@gmail.com>2017-02-22 21:15:14 +0800
committerLunny Xiao <xiaolunwen@gmail.com>2017-02-22 21:15:14 +0800
commit83b6d032318c7ba082531a9d0060b7109094b828 (patch)
tree4f76f95ea7defa5ae6465f63cdbf8659ee32b744 /models/repo_test.go
parentd6748284bd6b4424d0e50cb4b952d12c74203960 (diff)
downloadgitea-83b6d032318c7ba082531a9d0060b7109094b828.tar.gz
gitea-83b6d032318c7ba082531a9d0060b7109094b828.zip
fix: Wrong repo list on Explore page if user already loggin. (#1009)
* fix: Wrong repo list on Explore page if user already loggin. * fix: code readable. * fix: declare variable
Diffstat (limited to 'models/repo_test.go')
-rw-r--r--models/repo_test.go52
1 files changed, 52 insertions, 0 deletions
diff --git a/models/repo_test.go b/models/repo_test.go
index 7c0e94a5ae..ca1259a7ea 100644
--- a/models/repo_test.go
+++ b/models/repo_test.go
@@ -125,3 +125,55 @@ func TestForkRepository(t *testing.T) {
assert.Error(t, err)
assert.True(t, IsErrRepoAlreadyExist(err))
}
+
+func TestSearchRepositoryByName(t *testing.T) {
+ assert.NoError(t, PrepareTestDatabase())
+
+ // test search public repository on explore page
+ repos, count, err := SearchRepositoryByName(&SearchRepoOptions{
+ Keyword: "repo_12",
+ Page: 1,
+ PageSize: 10,
+ Searcher: nil,
+ })
+
+ assert.NotNil(t, repos)
+ assert.NoError(t, err)
+ assert.Equal(t, "test_repo_12", repos[0].Name)
+ assert.Equal(t, int64(1), count)
+
+ repos, count, err = SearchRepositoryByName(&SearchRepoOptions{
+ Keyword: "test_repo",
+ Page: 1,
+ PageSize: 10,
+ Searcher: nil,
+ })
+
+ assert.NotNil(t, repos)
+ assert.NoError(t, err)
+ assert.Equal(t, int64(2), count)
+
+ // test search private repository on explore page
+ repos, count, err = SearchRepositoryByName(&SearchRepoOptions{
+ Keyword: "repo_13",
+ Page: 1,
+ PageSize: 10,
+ Searcher: &User{ID: 14},
+ })
+
+ assert.NotNil(t, repos)
+ assert.NoError(t, err)
+ assert.Equal(t, "test_repo_13", repos[0].Name)
+ assert.Equal(t, int64(1), count)
+
+ repos, count, err = SearchRepositoryByName(&SearchRepoOptions{
+ Keyword: "test_repo",
+ Page: 1,
+ PageSize: 10,
+ Searcher: &User{ID: 14},
+ })
+
+ assert.NotNil(t, repos)
+ assert.NoError(t, err)
+ assert.Equal(t, int64(3), count)
+}
-baseline'>automated/noid/stable29-update-psalm-baseline Nextcloud server, a safe home for all your data: https://github.com/nextcloud/serverwww-data
summaryrefslogtreecommitdiffstats
path: root/core/css/public.css
blob: 3e8ca2bbb34ab6f738c18a94f4898a0eed160aea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#body-public {
  /** don't apply content header padding on the base layout */
  /* force layout to make sure the content element's height matches its contents' height */
  /* public footer */
}
#body-public .header-right #header-primary-action a {
  color: var(--color-primary-text);
}
#body-public .header-right #header-secondary-action ul li {
  min-width: 270px;
}
#body-public .header-right #header-secondary-action #header-actions-toggle {
  background-color: transparent;
  border-color: transparent;
  filter: var(--background-invert-if-dark);
}
#body-public .header-right #header-secondary-action #header-actions-toggle:hover, #body-public .header-right #header-secondary-action #header-actions-toggle:focus, #body-public .header-right #header-secondary-action #header-actions-toggle:active {
  opacity: 1;
}
#body-public .header-right #header-secondary-action #external-share-menu-item form {
  display: flex;
}
#body-public .header-right #header-secondary-action #external-share-menu-item .hidden {
  display: none;
}
#body-public .header-right #header-secondary-action #external-share-menu-item #save-button-confirm {
  flex-grow: 0;
}
#body-public #content {
  min-height: calc(100% - 65px);
}
#body-public.layout-base #content {
  padding-top: 0;
}
#body-public .ie #content {
  display: inline-block;
}
#body-public p.info {
  margin: 20px auto;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.4);
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
#body-public p.info, #body-public form fieldset legend,
#body-public #datadirContent label,
#body-public form fieldset .warning-info,
#body-public form input[type=checkbox] + label {
  text-align: center;
}
#body-public footer {
  position: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 65px;
  flex-direction: column;
  bottom: 0;
  width: calc(100% - 16px);
  margin: 8px;
  background-color: var(--color-main-background);
  border-radius: var(--border-radius-large);
}
#body-public footer p {
  text-align: center;
  color: var(--color-text-lighter);
}
#body-public footer p a {
  color: var(--color-text-lighter);
  font-weight: bold;
  white-space: nowrap;
  /* increasing clickability to more than the text height */
  padding: 10px;
  margin: -10px;
  line-height: 200%;
}

/*# sourceMappingURL=public.css.map */