FIX: better message if request for report is rate limited (#6298)

This commit is contained in:
Joffrey JAFFEUX
2018-08-22 11:25:12 +02:00
committed by GitHub
parent 50955dbe30
commit 599cebf8ad
5 changed files with 59 additions and 17 deletions

View File

@ -130,3 +130,25 @@ componentTest("exception", {
assert.ok(exists(".alert-error.exception"), "it displays an error");
}
});
componentTest("rate limited", {
beforeEach() {
const response = object => {
return [429, { "Content-Type": "application/json" }, object];
};
// prettier-ignore
server.get("/admin/reports/signups_rate_limited", () => { //eslint-disable-line
return response({"errors":["You’ve performed this action too many times. Please wait 10 seconds before trying again."],"error_type":"rate_limit","extras":{"wait_seconds":10}});
});
},
template: "{{admin-report dataSourceName='signups_rate_limited'}}",
test(assert) {
assert.ok(
exists(".alert-error.rate-limited"),
"it displays a rate limited error"
);
}
});