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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:52:53+00:00 2026-05-26T23:52:53+00:00

I am using Rspec 2.6.1 on Rails 3.1. I am trying out a simple

  • 0

I am using Rspec 2.6.1 on Rails 3.1.

I am trying out a simple test from rails tutorial. Here is what I have in a spec/controllers/pages_controller_spec.rb :

  describe "GET 'home'" do
    it "returns http success" do
      get 'home'
      response.should be_success  #test1
      response.should have_selector ("title", :content => "Home") #test2
    end
  end

Everything works if I have only the first #test1 in the file. This means the setup is fine. But the moment I add #test2 I get bunch of errors and rspec is no longer able to run the tests. The root error seems to be a syntax error and shows up as follows:

syntax error, unexpected ')', expecting keyword_end

I looked around and that seems to be the correct syntax. Any Idea what the issue is?

  • 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-26T23:52:54+00:00Added an answer on May 26, 2026 at 11:52 pm

    Try to change

     response.should have_selector ("title", :content => "Home")
    

    to

     response.should have_selector("title", :content => "Home")
    

    I can’t say (because I can’t reproduce it right now) this will solve your problem but, for sure, it’s not a good idea to have a space there.

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

Sidebar

Related Questions

I have defined: a view at views/pages/about.html.rb , a test in spec/controllers/pages_controller_spec.rb : describe
I'm using rspec-rails, version 1.2.6. In a controller test describe WebsController do ... I
I'm using rails-rspec gem and I have several specs (models, controllers, etc). When I
Using ruby(1.8.7) , rails(2.3.8) , rspec(1.3.1) and rspec-rails(1.3.3) how do I test a method
I am using Ruby on Rails 3.2.2, cucumber-rails-1.3.0, rspec-rails-2.8.1, capybara-1.1.2 and factory_girl-2.6.3. I have
I'm going through a tutorial that has suggested using rspec , but I have
I'm writing an integration test for a rails application using Capybara within Rspec. After
I'm following the ruby on rails tutorial: http://railstutorial.org/chapters/static-pages#top I'm up to using rspec. Having
I am using rspec-rails what's the different between Post.title.should == test and Post.title should
I'm using RSpec 1 and rspec-rails to test my Rails 2.3.14 application. In this

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.