paulelliott/fabrication — Issue #85: Transformers are not been loaded 
Author: greis
Created: 2012-02-09 20:00:09+00:00
State: open

Transformers are not loaded if the first step in the scenario uses a transformer.
Example:

* feature

Scenario:
Given the following posts:
| title | summary | user | categories | published at |
| Post 1 | Welcome | Thais Camilo | Rails | 2012-01-01 |
| Unpublished | Welcome | Thais Camilo | Rails | |
| Future post | Welcome | Thais Camilo | Rails | 2022-01-08 |

* transform
Fabrication::Transform.define(:user, ->(name) do
first, last = name.split
Fabricate(:user, first_name: first, last_name: last)
end)

* error
User(#70363094022600) expected, got String(#70363056951740) (ActiveRecord::AssociationTypeMismatch)
./features/step_definitions/fabrication_steps.rb:16:in `block (2 levels) in '
./features/step_definitions/fabrication_steps.rb:4:in `with_ivars'
./features/step_definitions/fabrication_steps.rb:15:in `/^the following ([^"]*):$/'