Description
The provided assert_api_conform method does not perform actual assertions using Rails' testing framework. As a result, when this method is used in Rails tests, Rails emits a warning indicating that the test case does not perform any assertions.
Before Rails 7.2 you could configure Rails to ignore or only log such warnings (:ignore being the default):
config.active_support.assertionless_tests_behavior = :ignore
config.active_support.assertionless_tests_behavior = :log
With Rails 7.2, the ActiveSupport::TestCase emits warnings when tests are executed without any assertions, with no more way to configure the behavior.
Steps to Reproduce
- Set Up a Rails Test Case in a Rails app with version >= 7.2
require 'test_helper'
class ApiConformanceTest < ActiveSupport::TestCase
test "API response conforms to specification" do
get '/api/endpoint'
assert_api_conform(status: 200)
end
end
- Run the Tests:
- Observe the Warning:
Test is missing assertions: `test_API_response_conforms_to_specification` /path/to/test
Thank you for having a look and maintaining this great gem :)
Description
The provided
assert_api_conformmethod does not perform actual assertions using Rails' testing framework. As a result, when this method is used in Rails tests, Rails emits a warning indicating that the test case does not perform any assertions.Before Rails 7.2 you could configure Rails to ignore or only log such warnings (
:ignorebeing the default):With Rails 7.2, the
ActiveSupport::TestCaseemits warnings when tests are executed without any assertions, with no more way to configure the behavior.Steps to Reproduce
rails testThank you for having a look and maintaining this great gem :)