| @@ -101,6 +101,43 @@ func TestProfileAboutFormatAndPrivacy(t *testing.T) { |
| 101 | 101 | } |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | // A dot-repo is infrastructure: it stays out of explore and off the |
| 105 | // profile's repository list, and stays in the owner's own inventory. |
| 106 | func TestDotReposHiddenFromListings(t *testing.T) { |
| 107 | inst := startInstance(t) |
| 108 | aliceKey := inst.newKey(t, "alice") |
| 109 | inst.admin(t, "admin", "user", "create", "alice", |
| 110 | "--key", aliceKey+".pub", "--email", "alice@example.test", "--verified") |
| 111 | inst.ssh(t, aliceKey, "", "repo", "create", "alice/.gitbay") |
| 112 | inst.ssh(t, aliceKey, "", "repo", "create", "alice/app") |
| 113 | |
| 114 | out, _, _ := inst.ssh(t, aliceKey, "", "explore", "--json") |
| 115 | if strings.Contains(out, ".gitbay") { |
| 116 | t.Errorf("dot-repo listed in explore: %s", out) |
| 117 | } |
| 118 | if !strings.Contains(out, "alice/app") { |
| 119 | t.Errorf("ordinary repo missing from explore: %s", out) |
| 120 | } |
| 121 | |
| 122 | out, _, _ = inst.ssh(t, aliceKey, "", "profile", "show", "alice", "--json") |
| 123 | if strings.Contains(out, `"path":"alice/.gitbay"`) { |
| 124 | t.Errorf("dot-repo listed on the profile: %s", out) |
| 125 | } |
| 126 | if !strings.Contains(out, `"path":"alice/app"`) { |
| 127 | t.Errorf("ordinary repo missing from the profile: %s", out) |
| 128 | } |
| 129 | |
| 130 | out, _, _ = inst.ssh(t, aliceKey, "", "repo", "list", "--json") |
| 131 | if !strings.Contains(out, "alice/.gitbay") { |
| 132 | t.Errorf("dot-repo missing from the owner's own inventory: %s", out) |
| 133 | } |
| 134 | |
| 135 | // It is still reachable at its URL. |
| 136 | if _, page := inst.get(t, "/alice/.gitbay"); strings.Contains(page, "not found") { |
| 137 | t.Error("dot-repo page not reachable") |
| 138 | } |
| 139 | } |
| 140 | |
| 104 | 141 | // The about is not settable through profile set any more: it is a file. |
| 105 | 142 | func TestProfileSetHasNoAbout(t *testing.T) { |
| 106 | 143 | inst := startInstance(t) |