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

Add an optional syntax for better FactoryGirl support #11

Open
calebhearth opened this issue Jan 31, 2014 · 0 comments
Open

Add an optional syntax for better FactoryGirl support #11

calebhearth opened this issue Jan 31, 2014 · 0 comments

Comments

@calebhearth
Copy link
Owner

When I type fill_form(:user), that should function as fill_form(:user, attributes_for(:user)) currently does.

When I type fill_form(:user, :name, :email), that should function the same as fill_form(:user, attributes_for(:user).slice(:name, :email)) currently does.

When I type fill_form(:user, :name, password: 'password'), that should function the same as fill_form(:user, attributes_for(:user).slice(:name).merge(password: 'password')) currently does.

@ghost ghost assigned calebhearth Jan 31, 2014
calebhearth added a commit that referenced this issue Mar 14, 2014
Introduce optional FactoryGirl syntax that makes it easier to use
Formulaic to fill in attributes from a factory with a single argument:
`fill_with_factory(:user)`; limit the attributes from a factory:
`fill_with_factory(:user, :name, :address)`; and even pass arguments to
the factory, such as traits and overrides:
`fill_with_factory(:user, :name, :address, factory_arguments: [:with_verified_address]`.

Resolves #11.
calebhearth added a commit that referenced this issue Mar 14, 2014
Introduce optional FactoryGirl syntax that makes it easier to use
Formulaic to fill in attributes from a factory with a single argument:
`fill_with_factory(:user)`; limit the attributes from a factory:
`fill_with_factory(:user, :name, :address)`; and even pass arguments to
the factory, such as traits and overrides:
`fill_with_factory(:user, :name, :address, factory_arguments: [:with_verified_address]`.

Resolves #11.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant