Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use dynamic attributes in factories #3622

Merged
merged 4 commits into from
Aug 7, 2019
Merged

Use dynamic attributes in factories #3622

merged 4 commits into from
Aug 7, 2019

Conversation

javierm
Copy link
Member

@javierm javierm commented Jun 20, 2019

References

Objectives

  • Make it possible to upgrade factory bot in the future
  • Update rubocop rules regarding dynamic attributes in factories

@javierm javierm changed the title Use dynamic attributes factories Use dynamic attributes in factories Jun 20, 2019
@javierm javierm self-assigned this Jun 20, 2019
@javierm javierm force-pushed the use_dynamic_factories branch 2 times, most recently from 2c85114 to 2640d50 Compare August 7, 2019 14:10
@javierm javierm changed the base branch from master to fix_migrations August 7, 2019 14:10
@javierm javierm changed the base branch from fix_migrations to master August 7, 2019 15:13
These rules are now defined under `Style/`. However, we don't really use
them, so they add noise to the rubocop configuration file without
solving any issues we actually have.
Factory bot has stopped supporting dynamic attributes, and we'll have to
change all factories before upgrading.

In order to apply the rubocop rule, we need to bump rubocop-rspec to its
latest version.
Static attributes are deprecated since factory bot 4.11; we haven't
upgraded yet but now we're ready to do so:

https://thoughtbot.com/blog/deprecating-static-attributes-in-factory_bot-4-11
The reason for this rule is similar to dynamic factories: we want
dynamic dates to be evaluted relative to the current time, and not
relative to the moment the application was loaded.
@javierm
Copy link
Member Author

javierm commented Aug 7, 2019

Travis failure is not related to this pull request.

@javierm javierm merged commit 4b51ab4 into master Aug 7, 2019
@javierm javierm deleted the use_dynamic_factories branch August 7, 2019 18:32
@javierm javierm added this to Release 1.1.0 in Roadmap Sep 10, 2019
@javierm javierm added Refactoring Linters Rubocop, ERB Lint, ESLint, SCSS-Lint, ... Maintenance and removed Refactoring Linters Rubocop, ERB Lint, ESLint, SCSS-Lint, ... labels Sep 11, 2019
smarques pushed a commit to venetochevogliamo/consul that referenced this pull request Apr 29, 2020
…ries

Use dynamic attributes in factories
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Roadmap
  
Release 1.1.0
Development

Successfully merging this pull request may close these issues.

None yet

2 participants