Latest updates
This commit is contained in:
48
test/controllers/cafs_controller_test.rb
Normal file
48
test/controllers/cafs_controller_test.rb
Normal file
@@ -0,0 +1,48 @@
|
||||
require "test_helper"
|
||||
|
||||
class CafsControllerTest < ActionDispatch::IntegrationTest
|
||||
setup do
|
||||
@caf = cafs(:one)
|
||||
end
|
||||
|
||||
test "should get index" do
|
||||
get cafs_url
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should get new" do
|
||||
get new_caf_url
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should create caf" do
|
||||
assert_difference("Caf.count") do
|
||||
post cafs_url, params: { caf: { company_id: @caf.company_id, description: @caf.description, name: @caf.name } }
|
||||
end
|
||||
|
||||
assert_redirected_to caf_url(Caf.last)
|
||||
end
|
||||
|
||||
test "should show caf" do
|
||||
get caf_url(@caf)
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should get edit" do
|
||||
get edit_caf_url(@caf)
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should update caf" do
|
||||
patch caf_url(@caf), params: { caf: { company_id: @caf.company_id, description: @caf.description, name: @caf.name } }
|
||||
assert_redirected_to caf_url(@caf)
|
||||
end
|
||||
|
||||
test "should destroy caf" do
|
||||
assert_difference("Caf.count", -1) do
|
||||
delete caf_url(@caf)
|
||||
end
|
||||
|
||||
assert_redirected_to cafs_url
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user