Setup Faker in Rails
11 March 2022 (Updated 11 March 2022)
On this page
Install gem
Add to Gemfile:
group :development, :test do
gem 'faker'
end
Run:
./bin/bundle install
Use faker
require 'faker'
Faker::Name.name #=> "Christophe Bartell"
Faker::Internet.email #=> "kirsten.greenholt@corkeryfisher.info"
Sources
Tagged:
Rails testing
Thanks for your comment 🙏. Once it's approved, it will appear here.
Leave a comment