Jump to content

The ultimate community for Ruby on Rails developers.


Photo

Postgresql namespace and rake test

rake postgresql

  • Please log in to reply
1 reply to this topic

#1 stepan_perlov

stepan_perlov

    Passenger

  • Members
  • 2 posts

Posted 29 January 2014 - 09:32 PM

Good day!

 

I add supporting schema in my app.

In developing mode all work, but in test mode I have problem.

 

I found resolve:

 

> rake db:test:purge

> rake db:test:prepare

> rake db:test:clone_structure

 

db creating correctly, then I running:

 

> rake test:all

 

and have this problem:

 
1) Error:
ProductsControllerTest#test_should_get_index:
ActiveRecord::StatementInvalid: PG::UndefinedTable: ERROR:  relation "products_id_seq" does not exist
LINE 1: ...LECT COALESCE(MAX("id")+(SELECT increment_by FROM "products_...
                                                             ^
:               SELECT setval('"products_id_seq"', (SELECT COALESCE(MAX("id")+(SELECT increment_by FROM "products_id_seq"), (SELECT min_value FROM "products_id_seq")) FROM "store"."products"), false)
 
Problem with fixtures.
I adding id column for each test item, but this resolve doesn't help.
 
I need help.
 
Thanks!


#2 stepan_perlov

stepan_perlov

    Passenger

  • Members
  • 2 posts

Posted 01 February 2014 - 08:14 AM

I add in config/database.yml:

 

schema_search_path: store, public

 

And problem was solved.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users