Greg Oleksiak
Greg Oleksiak

Reputation: 73

relation "delayed_jobs" does not exist in Rails 3.0.3 cucumber tests

I am running a Rails 3.0.3 with Postgres 9.0.1 and delayed_job 2.1.1. I configured delayed_job for Solr reindexing on an after_save callback which works great in development. When running cucumber tests for the model in question's create method, I get:

(::) failed steps (::)

PGError: ERROR: relation "delayed_jobs" does not exist LINE 4: WHERE a.attrelid = '"delayed_jobs"'::regclass ^ : SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum WHERE a.attrelid = '"delayed_jobs"'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum (ActiveRecord::StatementInvalid) ./app/controllers/admin/items_controller.rb:11:in create' ./features/step_definitions/web_steps.rb:29 ./features/step_definitions/web_steps.rb:14:inwith_scope' ./features/step_definitions/web_steps.rb:28:in /^(?:|I )press "([^"]*)"(?: within "([^"]*)")?$/' features/admin/item_create.feature:20:inAnd I press "Create"'

Any ideas? Thanks

Upvotes: 2

Views: 1876

Answers (3)

Prashant Ravi Darshan
Prashant Ravi Darshan

Reputation: 545

please use

rake db:migrate:up VERSION=20080906120000 RAILS_ENV=test

Upvotes: 0

Alex Lang
Alex Lang

Reputation: 1308

i.e. you should run rake db:test:clone

Upvotes: 5

Szymon Lipiński
Szymon Lipiński

Reputation: 28594

Probably you haven't run migrations on the test database.

Upvotes: 3

Related Questions