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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:15:11+00:00 2026-06-17T09:15:11+00:00

I have a page that’s rendering lots of stuff when I really use it,

  • 0

I have a page that’s rendering lots of stuff when I really use it, but renders nothing in Capybara.

Controller goes like this:

class IdeasController < ApplicationController
  def index
    @ideas = Idea.all
  end

Relevant bit of the page goes like this:

<div class="accordion" id="accordion">
  Ideas length is <%= @ideas.length %>.
  <% @ideas.each do |idea| %>
    <div class="accordion-group">
      <div class="accordion-heading">
        <%= link_to(idea.title, '#idea_' + idea.id.to_s, class: "accordion-toggle", data: {toggle: "collapse", parent: "#accordion"}  ) %>
      </div>
      <%= div_for(idea, class: "accordion-body collapse") do %>
          <div class="accordion-inner">
            <%= render :partial => "idea", locals: { :idea => idea } %>
          </div>
      <% end %>
    </div>
  <% end %>
</div>

When viewed in Development, this works beautifully and I get loads of stuff in the view (my db is full of mock data). But when I pop it open mid-test using save_and_open_page, it’s completely empty, and says “Ideas length is 0”.

I did rake db:test:clone and rake db:test:prepare, but nada — stays empty.

Can you help me figure out why? Is there a way to peek into the test db and see if anything’s there?

Edit: Inspired by the comments, I realized the trouble must be that the test environment flushes things out every time, so obviously there’s nothing. In an (apparently misguided) attempt to resolve this, I did:

  before do
    create(:idea)
    visit root_path
    click_link "Log In"
  end

Note the create(:idea) line, which was supposed to trigger my Idea factory and stick a mock idea into the db (the factory works fine with other tests).

Now the page says:

Internal Server Error

SQLite3::BusyException: database is locked: INSERT INTO “users” (“created_at”, “email”, “name”, “provider”, “uid”, “updated_at”) VALUES (?, ?, ?, ?, ?, ?)

which is beyond weird. Rails s is running in the background.

As requested by commenter, full spec follows:

require 'spec_helper'

describe "Idea page", js: true do

  subject { page }

  before do
    create(:idea)
    visit root_path
    click_link "Log In"
  end

  context "Single idea" do
    before do
      save_and_open_page
        #click_link('Eligendi sint quod quia alias sed sit vitae repellendus.')
    end

    it { should have_selector('a',text:'Claim') }

  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-06-17T09:15:12+00:00Added an answer on June 17, 2026 at 9:15 am

    Creating the data using a factory is the correct approach. To fix the sqlite error, you might need to increase the timeout for the database.

    To do this, in config/database.yml

    Find the test: environment and set

    timeout:

    To a larger value. As recommended by the question SQLite3::BusyException

    After that, ensure that in spec/spec_helper.rb that you have the following line:

      config.use_transactional_fixtures = false
    

    And that you are using something like database_cleaner to keep your test db clean between tests.

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

Sidebar

Related Questions

I have a page that builds out a table. Nothing else on that page
I have a page that I would like to be able to use a
I have this page that does some funky database stuff that takes a couple
I have a page that lets the user edit the content of the page
I have a page that uses the Telerik RadListView control and a Telerik RadDataPager
I have a page that I want to update non stop, every few seconds.
I have a page that consists of a header div for navigation, a content
I have a page that I am using an Ajax Accordion and when I
I have a page that has no vertical scroll, rather, everything is displayed horizontally.
I have a page that uses another page via the include() function. The page

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.