Sha256: ca4a9d19991e813fa0f214fa8bb3e4a3214af5777de6991ed8e1c6be0abd5c6e
Contents?: true
Size: 956 Bytes
Versions: 4
Compression:
Stored size: 956 Bytes
Contents
require 'test_helper' class PeopleControllerTest < ActionDispatch::IntegrationTest setup do @person = people(:one) end test "should get index" do get people_url, as: :json assert_response :success end test "should create person" do assert_difference('Person.count') do post people_url, params: { people: { name: "test01", age: 10, role: 0 } }, as: :json end assert_response 201 end test "should show person" do get person_url(@person), as: :json assert_response :success end test "should update person" do patch person_url(@person), params: { people: { name: "test01", age: 10, role: 0 } }, as: :json assert_response 200 end test "should destroy person" do assert_difference('Person.count', -1) do delete person_url(@person), as: :json end assert_response 204 end end
Version data entries
4 entries across 4 versions & 1 rubygems