需要檢查需要一個Rspec的匹配當前URL
describe "SEO Error" do
it "URL" do
visit 'http://localhost:4000/'
current_path.should == 'http://localhost:4000/'
end
end
遇到錯誤當前URL像
Failure/Error: current_path.should == 'http://localhost:4000/'
expected: "http://localhost:4000/"
got: "/" (using ==)
任何想法?
很好的答案。我認爲'expected_path'和'current_path'應該交換。 – 23inhouse