add new file

This commit is contained in:
Sunandar
2017-02-03 17:56:43 +06:30
parent 538c898e06
commit cccf9c0e9b
21 changed files with 369 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
require 'test_helper'
class Api::ClientsControllerTest < ActionDispatch::IntegrationTest
# test "the truth" do
# assert true
# end
end

View File

@@ -0,0 +1,48 @@
require 'test_helper'
class ClientsControllerTest < ActionDispatch::IntegrationTest
setup do
@client = clients(:one)
end
test "should get index" do
get clients_url
assert_response :success
end
test "should get new" do
get new_client_url
assert_response :success
end
test "should create client" do
assert_difference('Client.count') do
post clients_url, params: { client: { } }
end
assert_redirected_to client_url(Client.last)
end
test "should show client" do
get client_url(@client)
assert_response :success
end
test "should get edit" do
get edit_client_url(@client)
assert_response :success
end
test "should update client" do
patch client_url(@client), params: { client: { } }
assert_redirected_to client_url(@client)
end
test "should destroy client" do
assert_difference('Client.count', -1) do
delete client_url(@client)
end
assert_redirected_to clients_url
end
end