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

  • SEARCH
  • Home
  • 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 527089
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:50:44+00:00 2026-05-13T08:50:44+00:00

In Rails, fixtures records seem to be inserted & deleted in isolation for a

  • 0

In Rails, fixtures records seem to be inserted & deleted in isolation for a given model. I’d like to test having many objects/rows in one transaction, eg. to check uniqueness. How to do it?

  • 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-13T08:50:44+00:00Added an answer on May 13, 2026 at 8:50 am

    Fixtures are not validated. When you set them up they can be totally wrong and Rails won’t complain until something blows up. It’s a good idea to make sure your initial test DB (that is seeded with your fixtures) is in a valid state before tests are run.

    For checking things like uniqueness, I would create the records on the fly and not rely on fixtures. Either create them right in your test case, or use something like FactoryGirl (which by the way, is a great way to clean up your tests and stop using fixtures completely).

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

Sidebar

Related Questions

I have a YML file containing fixtures for a Rails model (Comment) which looks
I'm having problems with my fixtures in Rails. I have two models, a message
Rails provides label references for associations in fixtures like this: ### in pirates.yml reginald:
I want to generate fixtures from the development database in Rails 3.1. I tried
After upgrading to Rails 3, fixtures that refer to other labelled fixtures (for relationships)
I have just installed Rspec and Rspec-rails. When i try to run the test,
I'm new to Django coming from Rails, and I am finding the Django fixtures
I assumed it was a Rails convention that mailer fixtures reside in a folder
I have a set of Test::Unit tests for a Rails application. It was developed
I've got a large rails test suite and I'm using Timecop just once. it

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.