Reputation: 24399
I've created a Rails engine
> rails plugin new my_engine --mountable
In the dummy app, I create a model and fixtures...
> cd test/dummy
> rails generate resource Owner name:string
I ensure there is fixture data.
I write a test in the dummy app to make sure fixtures are working.
test("owners"){assert Owner.all.count > 0 }
It fails.
So, how does one use fixtures from test/dummy to test an engine?
Upvotes: 4
Views: 841
Reputation: 24399
According to a discussion I've had on Github:
rails generate ...
from within the dummy app is basically doing the wrong thing when it puts fixtures in dummy/test/fixtures.
Fixtures can only live in one directory.
The solution then, is move them manually to the engine's test/fixtures directory. Or patch Rails.
Upvotes: 2