Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1042057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:26:51+00:00 2026-05-16T15:26:51+00:00

I’m getting the following problem with my functional test. mrbernz:mylife bernardleung$ ruby test/functional/forums_controller_test.rb …..

  • 0

I’m getting the following problem with my functional test.

mrbernz:mylife bernardleung$ ruby test/functional/forums_controller_test.rb
…..

1) Error:
test_should_create_forum(ForumsControllerTest):
ActiveRecord::StatementInvalid: Mysql::BadFieldError: Unknown column ‘id:3 name’ in ‘field list’: INSERT INTO roles (id, id:3 name) VALUES (707834473, ‘Moderator’)

A stack trace of the error points as follows…

/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in gem_original_require'
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in
require’
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:158:in require'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:265:in
require_or_load’
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:224:in depend_on'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:136:in
require_dependency’
/Library/Ruby/Gems/1.8/gems/activerecord-2.3.8/lib/active_record/fixtures.rb:853:in try_to_load_dependency'
/Library/Ruby/Gems/1.8/gems/activerecord-2.3.8/lib/active_record/fixtures.rb:868:in
require_fixture_classes’
/Library/Ruby/Gems/1.8/gems/activerecord-2.3.8/lib/active_record/fixtures.rb:865:in each'
/Library/Ruby/Gems/1.8/gems/activerecord-2.3.8/lib/active_record/fixtures.rb:865:in
require_fixture_classes’
/Library/Ruby/Gems/1.8/gems/activerecord-2.3.8/lib/active_record/fixtures.rb:848:in fixtures'
./test/functional/../test_helper.rb:35
test/functional/forums_controller_test.rb:1:in
require’
test/functional/forums_controller_test.rb:1
Unable to load roles_user, underlying cause no such file to load — roles_user

/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in gem_original_require'
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in
require’
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:158:in require'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:265:in
require_or_load’
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:224:in depend_on'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:136:in
require_dependency’
/Library/Ruby/Gems/1.8/gems/activerecord-2.3.8/lib/active_record/fixtures.rb:853:in try_to_load_dependency'
/Library/Ruby/Gems/1.8/gems/activerecord-2.3.8/lib/active_record/fixtures.rb:868:in
require_fixture_classes’
/Library/Ruby/Gems/1.8/gems/activerecord-2.3.8/lib/active_record/fixtures.rb:865:in each'
/Library/Ruby/Gems/1.8/gems/activerecord-2.3.8/lib/active_record/fixtures.rb:865:in
require_fixture_classes’
/Library/Ruby/Gems/1.8/gems/activerecord-2.3.8/lib/active_record/fixtures.rb:848:in `fixtures’
test/functional/forums_controller_test.rb:4

My forums_controller_test.rb looks as follows (first few lines anyway)

require File.dirname(__FILE__) + '/../test_helper'

class ForumsControllerTest < ActionController::TestCase
  fixtures :forums, :users, :roles, :roles_users

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

I don’t understand why it’s complaining about ‘roles_user’ as I don’t ask for it anywhere, and what I do ask for or declare is ‘roles_users’ which is a table I do have!

mysql> show tables;
+-----------------------+
| Tables_in_mylife_test |
+-----------------------+
| articles              |
| categories            |
| forums                |
| pages                 |
| posts                 |
| roles                 |
| roles_users           |
| schema_migrations     |
| topics                |
| users                 |
+-----------------------+
10 rows in set (0.15 sec)

help?!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T15:26:51+00:00Added an answer on May 16, 2026 at 3:26 pm

    Remove :roles_users from the fixtures declaration in ForumsControllerTest.
    By specifying :roles_users as a fixture it is trying to load a model called RolesUser. I’m assuming it is a has_and_belongs_to_many join table.

    Make sure your users.yml fixture has:

    user:
     roles: moderator
    

    and your roles.yml fixture has:

    moderator:
     name: 'Moderator'
    

    and that id values are not set in the user.yml or roles.yml files.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I am currently running into a problem where an element is coming back from
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.