Note that there are some explanatory texts on larger screens.

plurals
  1. POTest database structure is not created when using Factory girl with Rspec (Rails)
    primarykey
    data
    text
    <p>I am using FactoryGirl in my rails application instead of Fixtures.</p> <p>When i try to use factory girl in my test and create some test data, it shows like </p> <p><code>PG:Error relation "users" doesn't exists</code> (i have a model named User)</p> <p>But when i run <code>rake db:test:clone</code>, and then run the test, the test is passed. The <code>rake db:test:clone</code> command clones all the table structure from development db to test db, and this fixes the issue.</p> <p>But is there any way for me to not to run <code>rake db:test:clone</code> when using FactoryGirl? </p> <p>or what am i missing?</p> <p><strong>Update :</strong></p> <p>I found out one other thing, i have another application which uses Rspec and FactoryGirl. In that application below are executed when running <code>rake spec --trace</code> command</p> <pre><code>** Invoke spec (first_time) ** Invoke db:test:clone_structure (first_time) ** Invoke db:structure:dump (first_time) ** Invoke environment (first_time) ** Execute environment ** Invoke db:load_config (first_time) ** Execute db:load_config ** Execute db:structure:dump ** Invoke db:test:load_structure (first_time) ** Invoke db:test:purge (first_time) ** Invoke environment ** Invoke db:load_config ** Execute db:test:purge ** Execute db:test:load_structure ** Invoke db:structure:load (first_time) ** Invoke environment ** Invoke db:load_config ** Execute db:structure:load </code></pre> <p>But in any of the new application i see the below executed when running <code>rake spec --trace</code></p> <pre><code>** Invoke spec (first_time) ** Invoke noop (first_time) ** Execute noop ** Execute spec </code></pre> <p>Please suggest what am i missing?</p> <p>regards</p> <p>Balan</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload