rails 版本 5.2.2
require 'test_helper'
class SayControllerTest < ActionDispatch::IntegrationTest
test "should get hello" do
get say_hello_url
assert_response :success
end
test "should say hello in json" do
get say_hello_url
assert_equal "{\"hello\":\"Rails!\"}", @response.body
end
test "should say hello in json" do
get say_hello_url,{'user'=>"Join"}
assert_equal "{\"hello\":\"Join!\"}", @response.body
end
end
require 'test_helper'
class SayControllerTest < ActionDispatch::IntegrationTest
test "should get hello" do
get say_hello_url
assert_response :success
end
test "should say hello in json" do
get say_hello_url
assert_equal "{\"hello\":\"Rails!\"}", @response.body
end
test "should say hello in json" do
get say_hello_url,{'user'=>"Join"}
assert_equal "{\"hello\":\"Join!\"}", @response.body
end
end