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 6531739
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T09:54:52+00:00 2026-05-25T09:54:52+00:00

test/unit/user_test.rb holds: require ‘test_helper’ class UserTest < ActiveSupport::TestCase # Replace this with your real

  • 0

test/unit/user_test.rb holds:

require 'test_helper'

class UserTest < ActiveSupport::TestCase
  # Replace this with your real tests.
  test "the truth" do
    assert true
  end
end

And executing:

perrys-MacBook-Pro:iway perry_mac$ ruby -Itest test/unit/user_test.rb

Yields the following:

Loaded suite test/unit/user_test
Started
E
Finished in 0.006410 seconds.

  1) Error:
test_the_truth(UserTest):
ActiveRecord::StatementInvalid: SQLite3::SQLException: no such table: user_sessions: DELETE FROM "user_sessions" WHERE 1=1
    /Users/perry_mac/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.0.9/lib/active_record/connection_adapters/abstract_adapter.rb:207:in `rescue in log'
    /Users/perry_mac/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.0.9/lib/active_record/connection_adapters/abstract_adapter.rb:199:in `log'
    /Users/perry_mac/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.0.9/lib/active_record/connection_adapters/sqlite_adapter.rb:135:in `execute'
    /Users/perry_mac/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.0.9/lib/active_record/connection_adapters/abstract/database_statements.rb:288:in `update_sql'
    /Users/perry_mac/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.0.9/lib/active_record/connection_adapters/sqlite_adapter.rb:139:in `update_sql'
    /Users/perry_mac/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.0.9/lib/active_record/connection_adapters/abstract/database_statements.rb:293:in `delete_sql'
    /Users/perry_mac/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.0.9/lib/active_record/connection_adapters/sqlite_adapter.rb:145:in `delete_sql'
    /Users/perry_mac/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.0.9/lib/active_record/connection_adapters/abstract/database_statements.rb:54:in `delete'
    /Users/perry_mac/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.0.9/lib/active_record/connection_adapters/abstract/query_cache.rb:16:in `delete'
    /Users/perry_mac/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.0.9/lib/active_record/fixtures.rb:569:in `delete_existing_fixtures'
    /Users/perry_mac/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.0.9/lib/active_record/fixtures.rb:531:in `block (4 levels) in create_fixtures'
    /Users/perry_mac/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.0.9/lib/active_record/fixtures.rb:531:in `each'
    /Users/perry_mac/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.0.9/lib/active_record/fixtures.rb:531:in `block (3 levels) in create_fixtures'
    /Users/perry_mac/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.0.9/lib/active_record/connection_adapters/abstract/database_statements.rb:139:in `transaction'
    /Users/perry_mac/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.0.9/lib/active_record/fixtures.rb:530:in `block (2 levels) in create_fixtures'
    /Users/perry_mac/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.0.9/lib/active_record/connection_adapters/abstract_adapter.rb:109:in `disable_referential_integrity'
    /Users/perry_mac/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.0.9/lib/active_record/fixtures.rb:521:in `block in create_fixtures'
    /Users/perry_mac/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.0.9/lib/active_support/benchmarkable.rb:55:in `silence'
    /Users/perry_mac/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.0.9/lib/active_record/fixtures.rb:520:in `create_fixtures'
    /Users/perry_mac/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.0.9/lib/active_record/fixtures.rb:979:in `load_fixtures'
    /Users/perry_mac/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.0.9/lib/active_record/fixtures.rb:944:in `setup_fixtures'
    /Users/perry_mac/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.0.9/lib/active_support/callbacks.rb:415:in `_run_setup_callbacks'
    /Users/perry_mac/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.0.9/lib/active_support/testing/setup_and_teardown.rb:34:in `run'

1 tests, 0 assertions, 0 failures, 1 errors, 0 skips

The error statement comments on an SQL DELETE query, which seems bizarre. And why is it even referencing user_sessions here? This test used to pass. After some db migrations (adding columns to existing tables) it does not. Can someone help me bridge my understanding gap here? Is there some mysterious entity that I have to reload. I tried each of:

rake db:test:clone  
rake db:test:clone_structure    
rake db:test:load   
rake db:test:prepare    
rake db:test:purge  

… but still see the same output. I can drop my current git branch and start over, but I’d really like to understand what tripped me up first. Please indicate if there is a log or other source of info I should be looking at to untangle the problem.

ADDENDUM (schema.rb):

ActiveRecord::Schema.define(:version => 20110901142600) do

  create_table "users", :force => true do |t|
    t.string   "username"
    t.string   "email"
    t.string   "crypted_password"
    t.string   "password_salt"
    t.string   "persistence_token"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.datetime "last_request_at"
    t.datetime "current_login_at"
    t.datetime "last_login_at"
    t.string   "current_login_ip"
    t.string   "last_login_ip"
  end

end
  • 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-25T09:54:53+00:00Added an answer on May 25, 2026 at 9:54 am

    I think the key is in the 10th line of the stack trace:

    /Users/perry_mac/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.0.9/lib/active_record/fixtures.rb:569:in `delete_existing_fixtures'
    

    Notice fixtures.rb and delete_existing_fixtures. Rails cleans all the fixtures out of the database before running your test suite. Do you have a user_sessions.yml file in test/fixtures?

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

Sidebar

Related Questions

I have a unit test (example is modified Test::Unit documentation ) require 'test/unit' class
I want to create a unit test for a member function of a class
Is there a way to unit-test classes which require database connections? e.g. User-Classes (DB-)Object
Working with Test::Unit and Shoulda. Trying to test Users.create . My understanding is that
I'm using Test::Unit with shoulda to test a controller. Since I'm just testing the
I can typically test a regular Test::Unit method using the following commandline syntax for
I am using Ruby's Test::unit to compare the result of generated html with the
I'm trying to set up Factory Girl with Test::Unit and Shoulda in Ruby on
If unit-test names can become outdated over time and if you consider that the
My unit test keeps getting the following error: System.InvalidOperationException: The Connection is not open.

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.