— 環境 — rails-4.0.1 devise-3.2.2 rspec-rails-2.14.0 capybara-2.2.0 Controller Spec の場合 xhr メソッドの第二引数はアクション名を書きますが、Request Spec(結合テスト)の場合 xhr メソッドの第二引数には HTTP メソッド名(post や delete)に対応するパスを指定します。 Request Spec で Ajax リクエストをテストするコード spec/requests/comment_pages_spec.rb describe "Comment pages" do let(:user) { FactoryGirl.create(:user) } before { login user } subject { page } describe "Ajax request on Com