All notable changes to this project will be documented in this file.
This project adheres to Semantic Versioning.
- Treat transient factory_bot attributes as associations if they are named like a factory.
- Enabled MFA for RubyGems
- Added support for ActiveRecord >= 6.
- Lowered the priority of all steps in this gem to avoid issues with overlapping steps.
- Added a step to add file objects to a model:
Both single and double quotes are supported.
Given there is a user with the avatar file:"path/to/avatar.jpg"
- A step was added that allows modifying existing records with a similar syntax to creating new records:
(Given "Bob" is a user) And "Bob" has the email "[email protected]" and is subscribed
- This step will also work with doc strings or tables:
(Given "Bob" is a user) And the user above has these attributes: | name | Bob | | email | foo@bar.com |
- Cucumber 2.1.0 introduced some regressions which are being addressed with this patch:
- Fix the assignment of polymorphic associations.
- Restore the support for inherited traits within nested factories.
- Allow associations to be set for transient attributes if they are named after the model. For example, when there is a
Role
model and theuser
factory has a transient attributerole
, the following steps are now valid:Given there is a role And there is a user with the role above
- Removed development and test support for Ruby 1.8. Closes #32.
- Fix a bug that prevented created records to be named when using multiline attribute assignments
Given "Bob" is a user with these attributes: | email | [email protected] |
- CucumberFactory now raises an
ArgumentError
if some parts of a matched step were not used. For example, while this step was accepted in recent versions, it will now complain with the messageUnable to parse attributes " and the ".
:Given there is a user with the attribute 'foo' and the
-
Single quoted attribute values and model names are now supported. Example:
Given 'jack' is a user with the first name 'Jack'
-
Fix: Allow to use array assignments within a doc string or table assignment
Example:
Given there is a post with these attributes: |tags| ["urgent", "vip"] |
- Moved gem's code from
Cucumber
module intoCucumberFactory
module. - Instead of calling
Cucumber::Factory.add_steps(self)
,require 'cucumber_factory/add_steps'
instead.
- Replace deprecated
Fixnum
withInteger
- Allow to refer to previously set foreign keys
- Allow to set numbers without quotes
- Support array fields out of the box
- Allow to set has_many associations with square bracket notation
- Support multi line attribute assignment
- Support for Cucumber 3.0 and 3.1
- See GitHub