Rails 테스트 케이스에서만 ActionController::InvalidCrossOriginRequest 가 발생하는 경우가 무엇이 있을까요?

조회수 918회

해당 action까지 잘 들어오고 브라우저에서는 동작하는데 이렇게 테스트 케이스에서 콜하게 되면

class SubmissionsControllerTest < ActionController::TestCase
    ...
    test "제출 목록을 가져올 수 있다." do
        get :index, tryout_id: @tryout.id,  format: :js
    end
end

다음과 같은 에러가 발생합니다.

Minitest::UnexpectedError: ActionController::InvalidCrossOriginRequest: Security warning: an embedded <script> tag on another site requested protected JavaScript. If you know what you're doing, go ahead and disable forgery protection on this action to permit cross-origin JavaScript embedding.

발생할 수 있는 경우가 무엇이 있을까요?

1 답변

답변을 하려면 로그인이 필요합니다.

프로그래머스 커뮤니티는 개발자들을 위한 Q&A 서비스입니다. 로그인해야 답변을 작성하실 수 있습니다.

(ಠ_ಠ)
(ಠ‿ಠ)