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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:47:25+00:00 2026-05-26T06:47:25+00:00

Here is the failed rspec code: require ‘spec_helper’ describe MainMenuController do describe GET ‘first_page’

  • 0

Here is the failed rspec code:

require 'spec_helper'

describe MainMenuController do

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

end

Here is the controller code:

class MainMenuController < ApplicationController
  def first_page
    session[:page_step] = 1
    redirect_to session[:page1]
  end

end

The spec error is:

 MainMenuController GET 'first_page' should be successful
     Failure/Error: response.should be_success
       expected success? to return true, got false
     # ./spec/controllers/main_menu_controller_spec.rb:8:in `block (3 levels) in <top (required)>'

The app runs fine without problem and the error may be caused by the rspec code which is automatically generated by the rails. Any idea about the problem? Thanks.

  • 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-26T06:47:25+00:00Added an answer on May 26, 2026 at 6:47 am

    I guess the matcher is looking for a status 200.

    But since you redirect, it gets 301.

    Thus it fails.

    Try:

    response.status.should eq 301
    

    You’d have some more details.

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

Sidebar

Related Questions

Please see my code below. ifstream myLibFile (libs//%s , line); // Compile failed here
Here is a java line of code that i have failed to understand. String
gem install heroku failed with following message and I have tried the solution here
After my last, failed, attempt at asking a question here I'm trying a more
Here is my code, which takes two version identifiers in the form 1, 5,
Here is a code snippet from my project: template<typename Second, typename First = const
Here is what I have. And that kind of work. it should filter by
there. I've searched my question around here but failed to find anything relevant. This
I trying to get a backtrace with rspec but I can't get it working
Can someone explain to me what is wrong here. Learning RSpec - I am

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.