1

私のルートには、次のものがあります。

match '/:org_id/users/:id/receive_message' => 'users#receive_message', :via => [:get, :post], :org_id => /[a-z0-9.-]+/i, :id => /[a-z0-9.-]+/i

私のルートテストでは、次のものがあります。

assert_routing({method: 'post', path: '/test4.example.com/users/user.test.email/receive_message'}, {controller: "users", action: "receive_message", org_id: "test4.example.com", id: "user.test.email"})

これはうまくいきます。アクションで統合テストを行う場合を除いて

post "/123/users/456/receive_message"

http://example.com/123/users/456/receive_messageへの 301 リダイレクトを受け取ります

このアクションのデバイス認証とauthenticity_tokenチェックをオフにしました。統合テストの before_* フィルターのいずれにも到達しません。アクションは本番環境で正常に機能しています。ユニット、コントローラー、および統合テストには標準の Rails 4 テスト フレームワークを使用し、モックには FactoryGirl を使用します。

何か案は?

4

0 に答える 0