Ruby on Rails Thursday, June 30, 2016

I have


When I run

rake test app/test/controllers/admin/post_categories_controller.rb`

I get errors like:

  1) Error:
ActiveRecord::StatementInvalid: PG::UndefinedTable: ERROR:  relation "admin_post_categories" does not exist
LINE 1: DELETE FROM "admin_post_categories"

Here's part of my `post_categories_controller_test.rb`:

require 'test_helper'

class Admin::PostCategoriesControllerTest < ActionController::TestCase
  setup do
    @post_category = post_categories(:one)

  test "should get index" do
    get :index
    assert_response :success
    assert_not_nil assigns(:post_categories)

  test "should get new" do
    get :new
    assert_response :success

So, basically my problem is that controllers, views and other things are namespaced (for now there is an "admin" namespace, but I will also add a "public" namespace later), but I want to use the same models (not namespaced models) for both the admin and the public area of this system.

Thanks in advance for any help.

You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
To view this discussion on the web visit
For more options, visit

No comments:

Post a Comment