|
158 | 158 | (state-flow.server/request! {:method :get |
159 | 159 | :uri "/api/social/author/delboni/github"}))) |
160 | 160 |
|
| 161 | + (flow "should return top authors" |
| 162 | + (match? {:status 200 |
| 163 | + :body [{:author-id string? |
| 164 | + :login "delboni" |
| 165 | + :account-source "github" |
| 166 | + :avatar-url "https://my.pic/me.jpg" |
| 167 | + :created-at string? |
| 168 | + :interactions 1}]} |
| 169 | + (state-flow.server/request! {:method :get |
| 170 | + :uri "/api/social/query/top-authors"}))) |
| 171 | + |
| 172 | + (flow "should return latest interactions" |
| 173 | + (match? {:status 200 |
| 174 | + :body [{:note-id string? |
| 175 | + :definition-id "clojure.core/disj" |
| 176 | + :body "my edited note about this function." |
| 177 | + :created-at string? |
| 178 | + :author {:author-id string? |
| 179 | + :login "delboni" |
| 180 | + :account-source "github" |
| 181 | + :avatar-url "https://my.pic/me.jpg" |
| 182 | + :created-at string?}}]} |
| 183 | + (state-flow.server/request! {:method :get |
| 184 | + :uri "/api/social/query/latest-interactions"}))) |
| 185 | + |
161 | 186 | (flow "should not be able to delete if not allowed" |
162 | 187 | (match? {:status 403 |
163 | 188 | :body "You not allowed to delete this note."} |
|
246 | 271 | (state-flow.server/request! {:method :get |
247 | 272 | :uri "/api/social/author/delboni/github"}))) |
248 | 273 |
|
| 274 | + (flow "should return top authors" |
| 275 | + (match? {:status 200 |
| 276 | + :body [{:author-id string? |
| 277 | + :login "delboni" |
| 278 | + :account-source "github" |
| 279 | + :avatar-url "https://my.pic/me.jpg" |
| 280 | + :created-at string? |
| 281 | + :interactions 1}]} |
| 282 | + (state-flow.server/request! {:method :get |
| 283 | + :uri "/api/social/query/top-authors"}))) |
| 284 | + |
| 285 | + (flow "should return latest interactions" |
| 286 | + (match? {:status 200 |
| 287 | + :body [{:see-also-id see-also-id |
| 288 | + :definition-id "clojure.core/disj" |
| 289 | + :definition-id-to "clojure.core/dissoc" |
| 290 | + :created-at string?}]} |
| 291 | + (state-flow.server/request! {:method :get |
| 292 | + :uri "/api/social/query/latest-interactions"}))) |
| 293 | + |
249 | 294 | (flow "should not be able to delete if not allowed" |
250 | 295 | (match? {:status 403 |
251 | 296 | :body "You not allowed to delete this see also."} |
|
386 | 431 | (state-flow.server/request! {:method :get |
387 | 432 | :uri "/api/social/author/delboni/github"}))) |
388 | 433 |
|
| 434 | + (flow "should return top authors" |
| 435 | + (match? {:status 200 |
| 436 | + :body [{:author-id string? |
| 437 | + :login "delboni" |
| 438 | + :account-source "github" |
| 439 | + :avatar-url "https://my.pic/me.jpg" |
| 440 | + :created-at string? |
| 441 | + :interactions 2}]} |
| 442 | + (state-flow.server/request! {:method :get |
| 443 | + :uri "/api/social/query/top-authors"}))) |
| 444 | + |
| 445 | + (flow "should return latest interactions" |
| 446 | + (match? {:status 200 |
| 447 | + :body [{:example-id example-id |
| 448 | + :definition-id "clojure.core/disj" |
| 449 | + :body "my edited example about this function." |
| 450 | + :created-at string? |
| 451 | + :editors [{:author-id string? |
| 452 | + :login "delboni" |
| 453 | + :account-source "github" |
| 454 | + :avatar-url "https://my.pic/me.jpg" |
| 455 | + :created-at string? |
| 456 | + :edited-at string?} |
| 457 | + {:author-id string? |
| 458 | + :login "delboni" |
| 459 | + :account-source "github" |
| 460 | + :avatar-url "https://my.pic/me.jpg" |
| 461 | + :created-at string? |
| 462 | + :edited-at string?}]}]} |
| 463 | + (state-flow.server/request! {:method :get |
| 464 | + :uri "/api/social/query/latest-interactions"}))) |
| 465 | + |
389 | 466 | (flow "delete example revision part 1" |
390 | 467 | (state-flow.server/request! {:method :delete |
391 | 468 | :headers {"authorization" (str "Bearer " token)} |
|
0 commit comments