0
這裏是失敗的RSpec代碼:RSPEC衰竭得到
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
這裏是控制器代碼:
class MainMenuController < ApplicationController
def first_page
session[:page_step] = 1
redirect_to session[:page1]
end
end
該規範的錯誤是:
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)>'
該應用程序運行正常沒有問題,並且錯誤可能由導軌自動生成的rspec代碼引起。有關這個問題的任何想法?謝謝。
它實際上返回302.謝謝。 – user938363