Topic: Issue with rspec -- Could not find table 'users'

So I was doing spec tests until running into a weird problem,  all the other tests passed except those user related ones.
It complains "Could not find table 'users'".
e.g
UsersController GET 'new' should be successful
    Failure/Error: get 'new'
    Could not find table 'users'

It doesn't matter what I am testing, as long as I mentioned user (@user, :user), the test will fail

Here is a little chuck of my spec code

require 'spec_helper'

describe UsersController do
    render_views

   describe "GET 'show'" do
   
       before(:each) do
          @user = Factory(:user)
    end

    it "should be successful" do
          get :show, :id => @user
            response.should be_success
    end

the rest should be the same

Could anyone help me out here? Thank in advance!

Last edited by doctorxlove (2010-10-20 21:25:07)

Re: Issue with rspec -- Could not find table 'users'

Did you run rake db:test:prepare after the last time you used rake db:migrate?

Re: Issue with rspec -- Could not find table 'users'

I am a newbie...
Problem solved
Thank you andain, you are awesome.

Re: Issue with rspec -- Could not find table 'users'

Thanks!  Your reminder about this oversight helped me too.

Re: Issue with rspec -- Could not find table 'users'

This also helped me, although now I get an error:

Failure/Error: assert_select "tr>td", :text => 1.to_s, :count => 2
     MiniTest::Assertion:
      Expected exactly 2 elements matching "tr > td", found 6.