Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Fix bugs in givenUser/WithRole when combined withUserModel helper #69

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

brijs
Copy link

@brijs brijs commented Oct 5, 2015

Summary:

  • Added tests to verify combined use of withUserModel and givenUser (& givenUserWithRole). These failed previously.
  • Changed default User model to "User" instead of "user".
  • Removed "constructor" in User.login invocations.
  • Role.findOrCreate was incorrectly double-nesting the role-name. {name: {name: "testRole"} }

Summary:
 - Added tests to verify combined of withUserModel and givenUser (& givenUserWithRole). These failed previously.
 - Changed default User model to "User" instead of "user".
 - Removed "constructor" in User.login invocations.
 - Role.findOrCreate was incorrectly double-nesting the role-name. {name: {name: "testRole"} }
@slnode
Copy link

slnode commented Oct 5, 2015

Can one of the admins verify this patch? To accept patch and trigger a build add comment ".ok\W+to\W+test."

principalType: test.app.models.roleMapping.USER,
var userModelName = test.userModel ? test.userModel : '__USERMODEL__';
test.app.models.RoleMapping.create(
{principalId: test[userModelName].id,
Copy link
Contributor

Choose a reason for hiding this comment

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

should use modelKey

Added a new test to verify givenUserWithRole when using the default
User model.
LoicMahieu added a commit to LoicMahieu/loopback-testing that referenced this pull request Jan 14, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging this pull request may close these issues.

5 participants