samedi 20 juillet 2019

Rails: Undefined method 'name' in 'user' factory OR Undefined Method for all factories

I am currently using RSpec and Factory_Bot_Rails gems for testing an application, but I am running into the issue below.

When using factory_bot_rails version 5.0.2 gem, my factories now all give me an Undefined Method error for all my registered factories. If I downgrade the version of the gem to 4.11 it works.

For example for my users factory, which has name as one of the defined attributes, it displays the error

Undefined method 'name' in 'user' factory

I have tried so hard to fix this issue but it's not been feasible.

Any form of help will be highly appreciated.

Aucun commentaire:

Enregistrer un commentaire