Skip to content

Backport/do not allow duplicate role names - #2296

Merged
superkhau merged 2 commits into
2.xfrom
backport/do-not-allow-duplicate-role-names
May 5, 2016
Merged

Backport/do not allow duplicate role names#2296
superkhau merged 2 commits into
2.xfrom
backport/do-not-allow-duplicate-role-names

Conversation

@superkhau

Copy link
Copy Markdown
Contributor

Added jshint ignore line to make pass linting.

Comment thread test/role.test.js Outdated
// console.log('User: ', user.id);
Role.create({name: 'userRole'}, function(err, role) {
Role.create({ name: 'userRole' }, function(err, role) {
expect(err).to.exist; // jshint ignore:line

@superkhau superkhau May 5, 2016

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bajtos Do you know if there is a better way to fix this (besides ...to.exist())?

@superkhau
superkhau force-pushed the backport/do-not-allow-duplicate-role-names branch from 194338f to 7100c1a Compare May 5, 2016 04:05
Comment thread test/role.test.js
// console.log('User: ', user.id);
Role.create({name: 'userRole'}, function(err, role) {
Role.create({ name: 'userRole' }, function(err, role) {
expect(err).to.exist; //jshint ignore:line

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bajtos Do you know if there is a better way to fix this (besides ...to.exist())?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's fine with me, just squash the commit adding this line with the one you are fixing.

I think we should fix our eslint-config-loopback to reject lines like expect(err).to.exist too.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should fix our eslint-config-loopback to reject lines like expect(err).to.exist too.

loopbackio/eslint-config-loopback#6

@superkhau

Copy link
Copy Markdown
Contributor Author

@bajtos Review please.

@bajtos bajtos assigned superkhau and unassigned bajtos May 5, 2016
supasate added 2 commits May 5, 2016 10:51
- Also fix jshint error in backported test
Signed-off-by: Supasate Choochaisri <supasate.c@gmail.com>
@superkhau
superkhau force-pushed the backport/do-not-allow-duplicate-role-names branch from 7100c1a to e89fbd7 Compare May 5, 2016 17:52
@superkhau
superkhau merged commit 9311e91 into 2.x May 5, 2016
@superkhau
superkhau deleted the backport/do-not-allow-duplicate-role-names branch May 5, 2016 18:35
@superkhau superkhau removed the #review label May 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants