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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:58:17+00:00 2026-06-17T08:58:17+00:00

Something strange is going on with capybara and rspec, which I’m setting up on

  • 0

Something strange is going on with capybara and rspec, which I’m setting up on Ruby 1.9.3, Padrino 0.10.7, rspec 2.11.0, capybara 2.0.2.

A basic Padrino project set up haml and rspec (no custom code, yet!) other than just enough to load a “/” page (which I verified does render as expected by “puts page.content” within the specs below). Here’s the simple spec. “Bogus” doesn’t exist, but “Home” does…note that when I puts to console, the expected true/false are CORRECT, but for some reason, the matchers aren’t seeing the true/false correctly.

The one clue I have so far lies in the 2nd spec using should have_content(‘Bogus’) which is reporting that Proc is expected…

./spec/controllers/hello_world_spec.rb

require 'spec_helper'

require 'capybara'
require 'capybara/rspec'

describe 'The HelloWorld App', :type => :feature do

  context "per documentation" do 
    it "has bogus content" do
      visit '/'
      page.has_content?('Bogus')
    end

    it "does not have bogus content" do
      visit '/'
      page.should have_content("Bogus")
    end
  end

  context "should tests" do 
    it "has bogus content" do
      visit '/'
      page.has_content?('Bogus').should == true
    end

    it "does not have bogus content" do
      visit '/'
      page.has_content?('Bogus').should == false
    end
  end

  context "variables" do 
    it "has bogus content" do
      visit '/'
      result = page.has_content?('Bogus')
      puts result
      result.should == true
    end

    it "has Home content (expect TRUE!)" do
      visit '/'
      result = page.has_content?('Home')
      puts result
      result.should == true
    end

    it "does not have bogus content" do
      visit '/'
      result = page.has_content?('Bogus')
      puts result
      result.should == false
    end
  end
end

spec_helper.rb

PADRINO_ENV = 'test' unless defined?(PADRINO_ENV)
require File.expand_path(File.dirname(__FILE__) + "/../config/boot")

def app
  ##
  # You can handle all padrino applications using instead:
  Padrino.application
  # Askme.tap do |app|
  # end
end

RSpec.configure do |conf|
  conf.include Rack::Test::Methods
  Capybara.app = app
end

Output:

11:40:57:website >> bundle exec rspec spec/app/controllers/hello_world_controller_spec.rb 
WARNING: Nokogiri was built against LibXML version 2.8.0, but has dynamically loaded 2.7.8

The HelloWorld App
  per documentation
    has bogus content
    does not have bogus content (FAILED - 1)
  should tests
    has bogus content
    does not have bogus content
  variables
false
    has bogus content
true
    has Home content (expect TRUE!)
false
    does not have bogus content

Failures:

  1) The HelloWorld App per documentation does not have bogus content
     Failure/Error: page.should have_content("Bogus")
     TypeError:
       wrong argument type Capybara::RSpecMatchers::HaveText (expected Proc)
     # ./spec/app/controllers/hello_world_controller_spec.rb:16:in `block (3 levels) in <top (required)>'

Finished in 1.66 seconds
7 examples, 1 failure

Failed examples:

rspec ./spec/app/controllers/hello_world_controller_spec.rb:14 # The HelloWorld App per documentation does not have bogus content
  • 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-17T08:58:18+00:00Added an answer on June 17, 2026 at 8:58 am

    Turns out the culprit was having both “bacon” and “rspec” in the Gemfile. Capybara was being introduced to a project that utilized bacon for the test suite and examples being tried were rspec. Once bacon was removed from the bundled gems, the capybara specs ran per documentation.

    Since the bacon scripts run more or less as-is under rspec, the project decision is to remove bacon and go with rspec for the test suite and make the minor tweaks to the bacon scripts to run all specs under rspec.

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

Sidebar

Related Questions

Something very strange is going on with a custom view containing a TextView .
Something really strange is going on here. I bought a new Mac last week,
I have something strange going on with my application. Below is my code where
I am learning about LINQ-to-SQL and everything was going well until something strange happened:
I have something strange going on with some of my repos .. Xcode seems
there is something strange going on with the Shopify API, I cannot understand what
I have something rather strange going on at the moment with my code. I
Something strange is going on with BigDecimal when you take the sqrt of a
There is something strange going on. I am using Zend Framework on a subfolder
I'm getting something pretty strange going on when trying to read some data using

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.