문제

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?

도움이 되었습니까?

해결책

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

As you were.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top