Questions tagged [faker]

An extension or library used in certain programming languages or frameworks (namely Ruby or Yii2) for generating fake data for debug purposes and testing.

In Ruby, Faker, a port of Data::Faker from Perl, is used to easily generate fake data: names, addresses, phone numbers, etc.

In Yii2, Faker can generate random strings (like name, address, phone number or anything), random numbers, keys or harshes as well as long sentences of fake text. It can be accessed in OOP style.

A PHP library is available for Faker that is used in some frameworks such as Laravel.

703 questions
0
votes
1 answer

Laravel Fzaninotto Faker Seed File: [ErrorException] copy(): The first argument to copy() function cannot be a directory

I want to create some files for my seedfile using fzaninotto/faker. file($sourceDir = '/tmp', $targetDir = '/tmp') // '/path/to/targetDir/13b73edae8443990be1aa8f1a483bc27.jpg' file($sourceDir, $targetDir, false) //…
LoveAndHappiness
  • 9,735
  • 21
  • 72
  • 106
0
votes
1 answer

Name Error: Topics, Rake db: reset error that I cannot pinpoint the source of

I keep getting the following error in my terminal when I rake db:reset. I am not sure why the topics object is undefined. I have created a topics controller and model, here the code: NameError: undefined local variable or method `topics' for…
Eric Park
  • 502
  • 2
  • 7
  • 23
0
votes
1 answer

I need an earthquake early warning system

I'm working on an earthquake early warning system. some one told me I had found a similar solution in http://remotegun.com/earthquake-early-warning-system/ but I couldn't find anything online. also I couldn't get answer from by mail. Thing I…
Miti
  • 1
0
votes
2 answers

Faker seed data coding error

I’m a new rails student working on a project that has a user login, each user has one list and each list has many items. Items are nested under lists in my routes. I’m having a few issues. My code below loads one user and one list for that user,…
Dale Brown
  • 305
  • 1
  • 4
  • 8
0
votes
2 answers

Rspec + FactoryGirl + Faker tests failing randomly

I have a study-case project, working with Rails 4, RSpec, FactoryGirl, Faker... But rspec tests are failing randomly, on development env. I'am searching a lot, but if anyone could help me figure it out, I would appreciated. Here are the links to…
Marcelo Boeira
  • 860
  • 8
  • 22
0
votes
1 answer

How to load massive amounts of data for demo in rails application

I have a rails application that has several associations. There will be a lot of content like youtube videos and images as well. One way I can think of doing this is, by using factory girl but I cant find a way to deump the data into my development…
whizcreed
  • 2,700
  • 3
  • 22
  • 35
0
votes
2 answers

Cartalyst Sentry a login is required, none given

I use Cartalyst Sentry for authentication. When I try to seed my database from command line, I get this error: [Cartalyst\Sentry\Users\LoginRequiredException] A login is required for a user, none given. This is my DatabaseSeeder.php…
Nasif Md. Tanjim
  • 3,862
  • 4
  • 28
  • 38
0
votes
0 answers

Ran Seed Data on Production Mysql Database Cleardb Heroku Data randomly generated fabricator faker

I have a simple rails app hosted on heroku using their cleardb mysql add on. I was developing on mysql locally. I am having problem with seeding data on production db on heroku. my seed data looks like this in db/seeds.rb. The app is using faker and…
Jngai1297
  • 2,415
  • 5
  • 29
  • 63
0
votes
1 answer

faker library and Prepared Statement Not Working with no errors Being Displayed

hi I am using the Faker library to generate random data to populate a table for a project I am working on, as you can see I am preparing the statement then setting all the variables for the statement in a array. finally I am executing the…
Mattyboi1670
  • 37
  • 10
0
votes
0 answers

Faker Gem producing blank names randomly

Versions: faker 1.4.3 ruby ruby 2.1.3p242 rails 4.0.0 I've been using Faker for a while now without issues. However, I am at the point where I would like to begin validating for string presence/lengths and I am running into an issue with…
kevinweaver
  • 523
  • 1
  • 4
  • 14
0
votes
1 answer

List of Factory Muffin generators

I'm using Laravel's built in unit testing to test my model validations, and I'm also using Factory Muffin to generate fake data for my models. It's working, however I'm having a really hard time finding the complete list of generators I can use to…
John Dorean
  • 3,744
  • 9
  • 51
  • 82
0
votes
1 answer

FactoryGirl clean up code

Here's my Ride factory: FactoryGirl.define do factory :ride do departure_address "#{Faker::Address.street_address}, #{Faker::Address.city} #{Faker::Address.country}" end end How to clean up this ugly code? "#{Faker::Address.street_address},…
Webspirit
  • 1,013
  • 3
  • 12
  • 18
0
votes
1 answer

Putting Faker Gem Values to a Hash

I'm writing automated tests using Cucumber, Capybara, WebDriver, SitePrism, and Faker. I am new to this and need some help. I have the following steps.. Given (/^I have created a new active product$/) do @page =…
Ponchooo
  • 83
  • 1
  • 9
0
votes
1 answer

How can I use faker in conjunction with Robot Framework?

I've been trying to use the faker library to generate data without having it in my test cases as static data. I have tried calling fake.md5(raw_output=False) directly from my keyword and also by creating a variable and assigning it this value, but…
LeonH
  • 1,039
  • 2
  • 22
  • 45
0
votes
1 answer

Why are Faker's methods in several modules?

I'm looking at this Gem: https://github.com/stympy/faker I use it quite a lot, and it is very good, but I don't get why all of its methods are organised into modules: Faker::Code.isbn #=> "759021701-8" Faker::Address.longitude #=>…
Starkers
  • 10,273
  • 21
  • 95
  • 158