2
使用Rails 3.2.2,我剛安裝的RSpec並試圖我的第一個測試:rspec的應包括嘗試的Chomp數組
require 'spec_helper'
describe "Mains" do
describe "GET index" do
it "gets the page which has the proper content" do
get 'index.html'
response.status.should be(200)
response.body.should include("one")
end
end
end
當我運行規範,我得到
Failures:
1) Mains GET index gets the page which has the proper content
Failure/Error: response.body.should include("one")
NoMethodError:
undefined method `chomp' for ["one"]:Array
這都兩岸出來的Ryan Bates' Railscast 257,所以我有點失落
在此先感謝,
索引視圖和控制器的動作看起來怎麼樣? – nemesv 2012-03-18 08:27:05
同樣的bug這裏的時候,在包括匹配單詞不存在。也許是rspec中的一個bug。 – 2012-03-21 14:50:05