このスクリプトを使用して、rspec 経由でログイン ページをテストしています。
describe "Sessions" do
  describe "GET /sessions/new" do
    it "works! (now write some real specs)" do
      # Run the generator again with the --webrat flag if you want to use webrat methods/matchers
      post "/session/new", { :username => "user", :password => "pass" }
      response.should redirect_to("/dashboard")
    end
  end
end
これを試してみると、rspecは次のように言っています:
 ActionController::RoutingError:
 No route matches [POST] "/session/new"
しかし、私は /session/new が有効なルートであることを知っています。また、ユーザー名とパスワードをテストするget "sessions/new"代わりに、postまたはテストせずに、デフォルトとして生成されたものを試してみると、正常に動作します。post_via_redirect基本的に、ユーザーがユーザー名とパスワードを投稿するログインページをテストしようとしています。私がここに欠けているものはありますか?