Skip to content

Conversation

@JulienAmoros
Copy link
Contributor

As we were using ROM, we decided to write an article about how to use 'rom-factory' gem, we think it's a must-have tool when using ROM and we wanted to share this knowledge.

What do you think about this?

@JulienAmoros JulienAmoros changed the title Guides testing factories [guides] Testing - how to set up rom-factories Apr 11, 2019
@JulienAmoros JulienAmoros force-pushed the guides_testing-factories branch from b6d12a7 to e379181 Compare April 11, 2019 15:51
@JulienAmoros JulienAmoros force-pushed the guides_testing-factories branch from e379181 to acc4cdd Compare April 11, 2019 15:53
Copy link
Contributor

@ianks ianks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concept +1. Can you address the requested changes and quickly run the content through a spell checker such as Grammarly?

ROMFactory comes with Faker gem:

```ruby
YourFactory.define(:foo) do |f|
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we rename YourFactory to Factory

f.sequence(:name) { |n| "User#{n}" }
f.website 'http://personal.website'
f.some_integer 42
f.created_at Time.now.utc
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's make generating the time a block, so each created record has a new timestamp. This is more realistic in testing since records created later in the spec will have an increasing created_at

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants