diff --git a/models/fixtures/collaboration.yml b/models/fixtures/collaboration.yml index 4c3ac367f6..74f6f24c86 100644 --- a/models/fixtures/collaboration.yml +++ b/models/fixtures/collaboration.yml @@ -4,6 +4,18 @@ user_id: 2 mode: 2 # write +- + id: 12 + repo_id: 2 + user_id: 4 + mode: 1 # read + +- + id: 13 + repo_id: 4 + user_id: 2 + mode: 1 # read + - id: 2 repo_id: 4 diff --git a/models/fixtures/repo_unit.yml b/models/fixtures/repo_unit.yml index f8bb8ef0d3..d53a7c9edd 100644 --- a/models/fixtures/repo_unit.yml +++ b/models/fixtures/repo_unit.yml @@ -736,7 +736,14 @@ - id: 111 - repo_id: 3 + repo_id: 2 + type: 10 + config: "{}" + created_unix: 946684810 + +- + id: 112 + repo_id: 4 type: 10 config: "{}" created_unix: 946684810 diff --git a/models/repo/collaboration_test.go b/models/repo/collaboration_test.go index 7e06bffb72..7b346b3ed6 100644 --- a/models/repo/collaboration_test.go +++ b/models/repo/collaboration_test.go @@ -65,7 +65,7 @@ func TestRepository_IsCollaborator(t *testing.T) { } test(3, 2, true) test(3, unittest.NonexistentID, false) - test(4, 2, false) + test(4, 2, true) test(4, 4, true) }