Factory Hashes
We can use Factory Girl for generating factories that can be used to test APIs. These can be used like any other factory.
factory :user_params, class:Hash do
company_id '123'
user_id '234'
username 'test'
email "test@test.com"
first_name 'Foolish'
last_name 'tester'
initialize_with { attributes }
end
Written by Raison D'souza
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#