(t *testing.T)
| 879 | } |
| 880 | |
| 881 | func TestRevocationWithAdminChannels(t *testing.T) { |
| 882 | defer db.SuspendSequenceBatching()() |
| 883 | |
| 884 | rt := NewRestTester(t, &RestTesterConfig{SyncFn: channels.DocChannelsSyncFunction}) |
| 885 | defer rt.Close() |
| 886 | dataStore := rt.GetSingleDataStore() |
| 887 | |
| 888 | rt.CreateUser("user", []string{"A"}) |
| 889 | |
| 890 | resp := rt.SendAdminRequest("PUT", "/{{.keyspace}}/doc", `{"channels": ["A"]}`) |
| 891 | RequireStatus(t, resp, http.StatusCreated) |
| 892 | |
| 893 | changes := rt.WaitForChanges(2, "/{{.keyspace}}/_changes?since=0&revocations=true", "user", false) |
| 894 | |
| 895 | assert.Equal(t, "doc", changes.Results[1].ID) |
| 896 | assert.False(t, changes.Results[0].Revoked) |
| 897 | |
| 898 | resp = rt.SendAdminRequest("PUT", "/db/_user/user", GetUserPayload(t, "", "letmein", "", dataStore, []string{}, nil)) |
| 899 | RequireStatus(t, resp, http.StatusOK) |
| 900 | |
| 901 | changes = rt.WaitForChanges(2, fmt.Sprintf("/{{.keyspace}}/_changes?since=%d&revocations=true", 2), "user", false) |
| 902 | |
| 903 | assert.Equal(t, "doc", changes.Results[0].ID) |
| 904 | assert.True(t, changes.Results[0].Revoked) |
| 905 | } |
| 906 | |
| 907 | func TestRevocationWithAdminRoles(t *testing.T) { |
| 908 | defer db.SuspendSequenceBatching()() |
nothing calls this directly
no test coverage detected