You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ruby-hniu/test/controllers/new_class_tables_controller...

39 lines
1.1 KiB

require 'test_helper'
class NewClassTablesControllerTest < ActionDispatch::IntegrationTest
setup do
@new_class_table = new_class_tables(:one)
end
test "should get index" do
get new_class_tables_url, as: :json
assert_response :success
end
test "should create new_class_table" do
assert_difference('NewClassTable.count') do
post new_class_tables_url, params: { new_class_table: { is_use: @new_class_table.is_use, user_class_id: @new_class_table.user_class_id } }, as: :json
end
assert_response 201
end
test "should show new_class_table" do
get new_class_table_url(@new_class_table), as: :json
assert_response :success
end
test "should update new_class_table" do
patch new_class_table_url(@new_class_table), params: { new_class_table: { is_use: @new_class_table.is_use, user_class_id: @new_class_table.user_class_id } }, as: :json
assert_response 200
end
test "should destroy new_class_table" do
assert_difference('NewClassTable.count', -1) do
delete new_class_table_url(@new_class_table), as: :json
end
assert_response 204
end
end