1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Update api_functional_test.rb.tt

Replace magic number with named constant
This commit is contained in:
Artur Beljajev 2020-12-14 14:27:56 +02:00 committed by GitHub
parent 0ecf163cc8
commit 0be9a266b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -20,7 +20,7 @@ class <%= controller_class_name %>ControllerTest < ActionDispatch::IntegrationTe
post <%= index_helper %>_url, params: { <%= "#{singular_table_name}: { #{attributes_string} }" %> }, as: :json
end
assert_response 201
assert_response :created
end
test "should show <%= singular_table_name %>" do
@ -30,7 +30,7 @@ class <%= controller_class_name %>ControllerTest < ActionDispatch::IntegrationTe
test "should update <%= singular_table_name %>" do
patch <%= show_helper %>, params: { <%= "#{singular_table_name}: { #{attributes_string} }" %> }, as: :json
assert_response 200
assert_response :success
end
test "should destroy <%= singular_table_name %>" do
@ -38,7 +38,7 @@ class <%= controller_class_name %>ControllerTest < ActionDispatch::IntegrationTe
delete <%= show_helper %>, as: :json
end
assert_response 204
assert_response :no_content
end
end
<% end -%>