Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests fail as PG::Error: ERROR: relation "merit_actions" does not exist #20

Closed
teriiehina opened this issue Jul 30, 2012 · 3 comments
Closed

Comments

@teriiehina
Copy link

hello. playing around with merit. simple, does the job, like it.

everything in the app looks fine but I got an error while testing.
I guess there something missing in my test_helper but I couldn't find any clue in the docs nor the code.

 Error: test_should_update_user(UsersControllerTest)
   ActiveRecord::StatementInvalid: PG::Error: ERROR:  relation "merit_actions" does not exist
   LINE 4:              WHERE a.attrelid = '"merit_actions"'::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 = '"merit_actions"'::regclass
                  AND a.attnum > 0 AND NOT a.attisdropped
                ORDER BY a.attnum
 test/functional/users_controller_test.rb:43:in `block in <class:UsersControllerTest>'
     40:   end
      41: 
      42:   test "should update user" do
=> 43:     put :update, :id => @user.to_param, :user => @user.attributes
      44:     # assert_redirected_to user_path(assigns(:user))
      45:     assert_redirected_to user_settings_path
      46:   end

the test is simply:

  test "should update user" do
    put :update, :id => @user.to_param, :user => @user.attributes
    # assert_redirected_to user_path(assigns(:user))
    assert_redirected_to user_settings_path
  end
@teriiehina
Copy link
Author

update: running the migrations on the test DB seems to make the tests pass.
not really sure. I will try to investigate a little to be certain.

@tute
Copy link
Member

tute commented Aug 1, 2012

Did you run with rake or single files?
Closing the issue as it doesn't seem to be a merit issue, I'll be here anyway for if you need some help.

@tute tute closed this as completed Aug 1, 2012
@teriiehina
Copy link
Author

the command I used was

rake environment RAILS_ENV=test db:migrate

no more problem. sorry for the noise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants