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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T09:16:37+00:00 2026-06-18T09:16:37+00:00

require ‘spec_helper’ describe PagesController do render_views describe GET ‘home’ do it should be successful

  • 0
    require 'spec_helper'

describe PagesController do
  render_views

  describe "GET 'home'" do
    it "should be successful" do
      get 'home'
      response.should be_success
    end
  end

  describe "GET 'about'" do
    it "should be successful" do
      get 'about'
      response.should be_success
    end
  end

  describe "GET 'contact'" do
    it "should be successful" do
      response.should be_success
    end
  end




end

Above is a very simple test I’ve written while learning the basics of testing in Ruby on rails, the problem is that it should be failing the “contact” test since I don’t have this in my app/controllers/pages_controller.rb.

It return the following

   Finished in 0.04558 seconds
3 examples, 0 failures

So it counts the test successfully but doesn’t fail if one of them is wrong.

  • 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-18T09:16:38+00:00Added an answer on June 18, 2026 at 9:16 am

    If you have already the view files in contact, that’s might be the reason to pass contact. Try to remove those files or rename the files and check again.

    (or)

    You might run into the same issues if you don’t turn off caching in the test environment. Go to config/environments/test.rb and change config.cache_classes = true to config.cache_classes = false

    It’s might be the reason, if not let know.

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

Sidebar

Related Questions

require 'spec_helper' describe LayoutLinks do it should have a Home page at '/' do
require 'sinatra/base' class Foo < Sinatra::Base get('/foo') { 'foo' } end class Bar <
I require retrying to send a GWT RPC request if it fails (any response
require 'rubygems' require 'test/unit' class Thing attr_accessor :foo def set_stuff @foo = 'bar' end
When I require libraries from the ns form I get : test> (ns test
I require a GET reequest from my own server to be extracted from the
require 'net/http' 1.upto(99) do |novel| puts Downloading ##{novel}... Net::HTTP.start(http://www.nbc.com) do |http| resp = http.get(/heroes/novels/downloads/Heroes_novel_0#{novel}.pdf)
require 'rubygems' require 'mechanize' agent = Mechanize.new page = agent.get(http://google.com/) This simple script works
require 'liquid' require 'extras/liquid_view' if defined? ActionView::Template and ActionView::Template.respond_to? :register_template_handler ActionView::Template else ActionView::Base end.register_template_handler(:liquid,
Require.js seems to be adding ?v= at the end of my http requests for

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.