add test
This commit is contained in:
1 parent
c2ffe19d44
commit
a1c4d00eed
1 file changed
+8
-8
@@ -54,6 +54,14 @@ module('Acceptance | users', function (hooks) {
|
||||
assert.equal(this.server.db.users[0].name, 'Updated user name');
|
||||
});
|
||||
|
||||
test('cannot make changes to an existing user without proper authorization', async function (assert) {
|
||||
assert.expect(1);
|
||||
instances.user.authorized_actions =
|
||||
instances.user.authorized_actions.filter((item) => item !== 'update');
|
||||
await visit(userURL);
|
||||
assert.notOk(find('.rose-layout-page-actions .rose-button-secondary'));
|
||||
});
|
||||
|
||||
test('can cancel changes to an existing user', async function (assert) {
|
||||
assert.expect(1);
|
||||
await visit(userURL);
|
||||
@@ -63,14 +71,6 @@ module('Acceptance | users', function (hooks) {
|
||||
assert.notEqual(find('[name="name"]').value, 'Unsaved user name');
|
||||
});
|
||||
|
||||
test('cannot make changes to an existing user without proper authorization', async function (assert) {
|
||||
assert.expect(1);
|
||||
instances.user.authorized_actions =
|
||||
instances.user.authorized_actions.filter((item) => item !== 'update');
|
||||
await visit(userURL);
|
||||
assert.notOk(find('.rose-layout-page-actions .rose-button-secondary'));
|
||||
});
|
||||
|
||||
test('saving an existing user with invalid fields displays error messages', async function (assert) {
|
||||
assert.expect(2);
|
||||
this.server.patch('/users/:id', () => {
|
||||
|
||||
Reference in new issue
Block a user