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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T08:25:41+00:00 2026-06-05T08:25:41+00:00

i am just starting to use cucumber and like it so far however there

  • 0

i am just starting to use cucumber and like it so far however there is one issue that seems very basic that I can’t work out. I am doing a very basic test of my homepage with the following:

home_pages.feature

Feature: Viewer visits the Home Page
        In order to read the page
        As a viewer
        I want to see the home page of my app

    Scenario: View home page
        Given I am on the home page
        Then I should see "Test" in the selector "h1"

    Scenario: Check Home Page Links
        Given I am on the home page
        Then I should see "How It Works" in a link
        And I should see "Sign Up" in a link
        And I should see "Log In" in a link

and cr1_steps.rb

Given /^I am on the home page$/ do
  visit root_path
end

Then /^I should see "([^"]*)" in the selector "([^"]*)"$/ do |text, selector|
  page.should have_selector selector, content: text
end

Then /^I should see "([^"]*)" in a link$/ do |text|
    page.should have_link text
end

home.html.erb

<div class="center hero-unit">
  <h1>Working</h1>
    <p>testing testing testing</p>
      <a class="btn btn-primary btn-large">
        Click This
      </a>
 </div>
  <ul class="thumbnails">
    <li class="span3">
      <div class="thumbnail">
        <img src="http://placehold.it/360x268" alt="">
      </div>
    </li>
  </ul>

However cucumber is passing even though the “h1” selector has “Working” in the home.html.erb, where as it should fail as I am testing for “h1″Test Any ideas why this could be

  • 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-05T08:25:43+00:00Added an answer on June 5, 2026 at 8:25 am

    I don’t see a :content option in the Capybara documentation for #has_selector?

    Try text: text instead.

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

Sidebar

Related Questions

I'm just starting to use sharepoint designer and realised there's a lot that can
I am just starting to use Wix and would like to use heat to
Or the concepts/best practices used there are now deprecated? I'm just starting to use
Just starting to use Cruise Control, but can't seem to find anything on this
Just starting to use Ruby on Rails to see what its like. I have
I'm just starting up with F# and see how you can use currying to
Just starting to use CodeIgniter, and I'd like to import some of my old
I am just starting to use Gaelyk. I was expecting it to behave like
I'm just starting to use Eclipse and I feel like I'm missing something in
I'm just starting to use the jQuery framework. I really like the look of

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.