Skip to content

Commit

Permalink
Fix api example
Browse files Browse the repository at this point in the history
  • Loading branch information
kbiala committed Dec 18, 2024
1 parent 6ff7bce commit eac1097
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions test/controllers/api/v1/ping_times_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,15 @@ def setup
payload: { 'test_key' => 'test_value' }.to_json
}
# Post the payload
post api_v1_collector_url,
headers: { 'Token' => @user.api_token },
params: valid_payload
assert_response 202
json = response_to_json(@response.body)
assert_equal 'Accepted', json['status']
assert_difference("Collector.count") do
post api_v1_collector_url,
headers: { 'Token' => @user.api_token },
params: valid_payload
assert_response 202
json = response_to_json(@response.body)
assert_equal 'Accepted', json['status']
end

# Verify that the record was saved successfully
collector = Collector.last
assert_equal 'ping', collector.payload_type
Expand Down

0 comments on commit eac1097

Please sign in to comment.