You can hear the action well and it works in the browser, but if you call from the test case like this,
class SubmissionsControllerTest < ActionController::TestCase
...
test "You can get a submission list" do
get :index, tryout_id: @tryout.id, format: :js
end
end
The following error occurs:
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.
What could happen?
ruby-on-rails testcase
xhr :get, tryout_id: @tryout.id, format: :js
I have to page you like this.
© 2024 OneMinuteCode. All rights reserved.