2021-12-28 14:45:20 +00:00
|
|
|
export default (ability) => (hooks) => {
|
|
|
|
hooks.beforeEach(function () {
|
2020-01-28 01:32:29 +00:00
|
|
|
this.ability = this.owner.lookup(`ability:${ability}`);
|
2021-04-29 20:00:59 +00:00
|
|
|
this.can = this.owner.lookup('service:can');
|
2020-01-28 01:32:29 +00:00
|
|
|
});
|
|
|
|
|
2021-12-28 14:45:20 +00:00
|
|
|
hooks.afterEach(function () {
|
2020-01-28 01:32:29 +00:00
|
|
|
delete this.ability;
|
2021-04-29 20:00:59 +00:00
|
|
|
delete this.can;
|
2020-01-28 01:32:29 +00:00
|
|
|
});
|
|
|
|
};
|