|
@@ -27,6 +27,12 @@ class Api::V1::RecordsControllerTest < ActionDispatch::IntegrationTest
|
27
|
27
|
headers: { Authorization: JsonWebToken.encode(user_id: @record.user_id) },
|
28
|
28
|
as: :json
|
29
|
29
|
assert_response :success
|
|
30
|
+
|
|
31
|
+ json_response = JSON.parse(self.response.body)
|
|
32
|
+ assert_equal @record.duration, json_response['data']['attributes']['duration']
|
|
33
|
+ assert_equal @record.user_id, json_response['data']['attributes']['user_id']
|
|
34
|
+ assert_equal @record.task_id, json_response['data']['attributes']['task_id']
|
|
35
|
+ assert_equal @record.is_handled, json_response['data']['attributes']['is_handled']
|
30
|
36
|
end
|
31
|
37
|
|
32
|
38
|
test "should not access show" do
|
|
@@ -34,4 +40,5 @@ class Api::V1::RecordsControllerTest < ActionDispatch::IntegrationTest
|
34
|
40
|
as: :json
|
35
|
41
|
assert_response :forbidden
|
36
|
42
|
end
|
|
43
|
+
|
37
|
44
|
end
|