Take the 2-minute tour ×

I'm retrieving a singleton can't be dumped error at some point after click_button is executed. All the rspec output tells me is:

1) home not logged in sign in should contain content with 'Add new charity
 Failure/Error: click_button "Install"
   singleton can't be dumped
 # (eval):2:in `click_button'
 # ./spec/integration/home_spec.rb:29:in `block (4 levels) in <top (required)>'

I've tried using the -b option, but I don't get any new info. Using logging in my controller, I can see that the action goes through and finalizes with a redirect. It must fail at some point after that, before the receiving action is called. So if there's a way I can better see the stack trace, i might be able to pinpoint the issue.

Added home_spec.rb

Using the shopify_api gem as you can see.

require 'spec_helper'

describe "home" do

  before do
    @domain = "myshop.myshopify.com"
    @token = SecureRandom.hex(16)
    @shopify_session = ShopifyAPI::Session.new(@domain, @token)

  context "not logged in" do
    it "should be at login" do
      visit "/"
      page.should have_content("Install this app in a shop to get access to its private admin data")

    describe "sign in" do
      before do



      it "should contain content with 'Add new charity" do
        visit "/"
        fill_in "shop", with: @domain
        click_button "Install"
        page.should have_content("Add new charity")

  context "logged in" do
    before do
      page.set_rack_session(:shopify => @shopify_session)

    it "should contain content with 'Add new charity" do
      visit "/"
      page.should have_content("Add new charity")



# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV["RAILS_ENV"] ||= 'test'
require 'rspec/rails'
require 'rspec/autorun'
require 'capybara/rails' 
require 'capybara/dsl'
require "rack_session_access/capybara"

# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}

Rails.application.config do
  config.middleware.use RackSessionAccess::Middleware

RSpec.configure do |config|
  # == Mock Framework
  # config.mock_with :mocha
  # config.mock_with :flexmock
  # config.mock_with :rr
  config.mock_with :rspec

  # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
  config.fixture_path = "#{::Rails.root}/spec/factories"

  # examples within a transaction, remove the following line or assign false
  # instead of true.
  config.use_transactional_fixtures = true

  # If true, the base class of anonymous controllers will be inferred
  # automatically. This will be the default behavior in future versions of
  # rspec-rails.
  config.infer_base_class_for_anonymous_controllers = false

  # RSpec automatically cleans stuff out of backtraces;
  # sometimes this is annoying when trying to debug something e.g. a gem
  config.backtrace_clean_patterns = [
share|improve this question

1 Answer 1

up vote 1 down vote accepted

Have you considered using something like Pry to make this easier? It has something to do with one of your files that are being included in your home_spec.

Here is where you can find Pry: https://github.com/pry/pry

Then in your code you can insert binding.pry and you should be able to drop into the execution environment and inspect what's going on in an irb-like session.

Otherwise, you need to post your home_spec.rb so we can start to theorize.

share|improve this answer
I do have pry installed. I try it out and see if that gives me some more indepth knowledge with what's going on. I added the code for the spec file and the spec helper just in case. Thanks. –  agmcleod Feb 27 '12 at 18:03

Your Answer


