Added device jobs model

This commit is contained in:
2021-10-19 18:10:20 +02:00
parent 27fc2aa88c
commit c47fb955cf
7 changed files with 128 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
require "test_helper"
class DeviceJobsControllerTest < ActionDispatch::IntegrationTest
setup do
@device_job = device_jobs(:one)
end
test "should get index" do
get device_jobs_url, as: :json
assert_response :success
end
test "should create device_job" do
assert_difference('DeviceJob.count') do
post device_jobs_url, params: { device_job: { device_id: @device_job.device_id, id: @device_job.id, job_id: @device_job.job_id, references: @device_job.references } }, as: :json
end
assert_response 201
end
test "should show device_job" do
get device_job_url(@device_job), as: :json
assert_response :success
end
test "should update device_job" do
patch device_job_url(@device_job), params: { device_job: { device_id: @device_job.device_id, id: @device_job.id, job_id: @device_job.job_id, references: @device_job.references } }, as: :json
assert_response 200
end
test "should destroy device_job" do
assert_difference('DeviceJob.count', -1) do
delete device_job_url(@device_job), as: :json
end
assert_response 204
end
end