Question

I need to call user.invite! as part of my tests. This is using Devise invitable and so should both send an invitation to the user and also create an invitation token for them and save them to the database.

Unfortunately, in the test environment nothing happens and calling user.invite! simply returns nil and makes no changes to the user object.

How can I remedy this?

Was it helpful?

Solution

I'm an idiot. I stubbed the invite! method so it didn't do anything.

As you were.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top