I use cucumber to run integration tests.
I have a very large (30,000+ record) stardard setup for testing.
How can I leave that in the test.sqlite3 database without re-loading it ever?
I use cucumber to run integration tests.
I have a very large (30,000+ record) stardard setup for testing.
How can I leave that in the test.sqlite3 database without re-loading it ever?
The SQLite database is just a file. Couldn't you just copy over the desired database file (prepopulated with the data you want) prior to starting your tests?
OK, based on what you said, can you do this:
Background: Create verses
Given the following verses exist:
|number|text |
|2999 |hello|
|2998 |hello|
|2997 |hello|
|2996 |hello|
Scenario: A user sees only verses in their reading plan
Given I am signed in as the Reader "Rodreegez"
And I have reading recomendations
When I follow "Read"
Then I should see the following verses:
|number|text |
|2999 |hello|
|2998 |hello|
And I should not see the following verses:
|number|text |
|2997 |hello|
|2996 |hello|
Of course, that rather involves creating the verses from a model using something like Factory Girl. Would that be possible?
Cucumber will not clean out the database once the test run completes unless you put some code to do it in an After
block in your env.rb
file to do this.
If the data never changes then load it into the db once and assume it is there when you run cucumber. If you change some data in the db in your scenarios then make sure that you use transactional fixtures and those changes will be rolled back when the scenario finishes.