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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:35:00+00:00 2026-05-25T13:35:00+00:00

p = Factory(:model) ap Model.find(:all) #output to prove that it’s getting created so… the

  • 0
  p = Factory(:model) 

  ap Model.find(:all)  #output to prove that it's getting created

so… the print shows that the IDs of the objects is going up…. but the database remains empty as I continually refresh the view on MySQL workbench — so my cucumber tests fail, because the controllers pull stuff from the database… but there is nothing in the database! =(

My Gem file: test

group :test do
    gem "cucumber", "~>0.10.3"
    gem "cucumber-rails", "0.3.2"
    gem "launchy"
    gem "hpricot"
    gem "gherkin", "~>2.4.0"

    gem "capybara", "0.4.1.2"
    gem "rspec", "1.3.2"
    gem "rspec-rails", "1.3.2"
    gem "rspec-core"
    gem "rspec-expectations"

    gem "webrat", "0.7.0"
    gem "database_cleaner"

    gem "factory_girl", "1.2.4"
    gem "shoulda", :require => nil
    gem "shoulda-matchers", :git => "https://github.com/thoughtbot/shoulda-matchers"
    gem "awesome_print"
    gem "cobravsmongoose"
end

My Requires for env.rb (cucumber env)

ENV["RAILS_ENV"] = 'test'
ENV["RACK_ENV"] = 'test'

BASE_DOMAIN = "myapp.dev" #using POW

require File.expand_path(File.dirname(__FILE__) + '/../../config/environment')

require 'cucumber/formatter/unicode' # Remove this line if you don't want Cucumber Unicode support
require 'cucumber/rails/world'
require 'cucumber/rails/active_record'
require 'cucumber/web/tableish'
require 'cucumber/rails/rspec' 
require 'rake'

require 'shoulda'
require 'factory_girl'
require 'factory_girl/step_definitions'
require 'awesome_print'


require 'capybara/rails'
require 'capybara/cucumber'
require 'capybara/session'

And in envs/test.rb

Bundler.require(:test) #just in case I forgot something

EDIT:

Some console output
Factory(:model).errors =>

#<ActiveRecord::Errors:0x10c5a6498 @base=#<ModelName id: 1, name: "Ready or not", status: 0, account_id: 2, user_id: 1, created_at: "2011-09-08 15:09:05", updated_at: "2011-09-08 15:09:05", description: "Things are not as they used to be", value: #<BigDecimal:10cb2c188,'0.12345E5',9(18)>, category_id: nil, allow_downloads: true, visibility: 1, locked: nil>, @errors=#<OrderedHash {}>>

And looking at the console during runtime, this object is def getting in INSERT INTO command… but there is this:

RELEASE SAVEPOINT active_record_1
  SQL (1.3ms)   ROLLBACK

which I feel might be what is causing the problem…. some sort of pre-emptive rollback.

  • 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-25T13:35:01+00:00Added an answer on May 25, 2026 at 1:35 pm

    Try this then:

    in env.rb

    require 'database_cleaner'
    require 'database_cleaner/cucumber'
    DatabaseCleaner.strategy = nil
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a factory class, DocumentLoaderFactory , which simply returns an instance that implements
I'm writing a factory class that should be able to return singleton instances of
I just read Factory Method. I understand that it provides a way to delegate
I have a factory method that generates django form classes like so: def get_indicator_form(indicator,
All, I am missing something fundamental about the underlying model for Django's ForeingKeys vs
For the sake of simplicity say I have multiple Xtext DSLs that all describe
I want to have one model & view that is served by multiple controllers
Service dependency is not enough to guarantee that database clients will find their SQL
I have a roles model in a rails app that I have written a
I've been researching all morning trying to find best practices for accessing your IoC.

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.