Added table jobs and table devices

This commit is contained in:
2021-10-19 17:50:25 +02:00
parent fc293608fa
commit 27fc2aa88c
13 changed files with 239 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
require "test_helper"
class DevicesControllerTest < ActionDispatch::IntegrationTest
setup do
@device = devices(:one)
end
test "should get index" do
get devices_url, as: :json
assert_response :success
end
test "should create device" do
assert_difference('Device.count') do
post devices_url, params: { device: { device_id: @device.device_id, id: @device.id } }, as: :json
end
assert_response 201
end
test "should show device" do
get device_url(@device), as: :json
assert_response :success
end
test "should update device" do
patch device_url(@device), params: { device: { device_id: @device.device_id, id: @device.id } }, as: :json
assert_response 200
end
test "should destroy device" do
assert_difference('Device.count', -1) do
delete device_url(@device), as: :json
end
assert_response 204
end
end