lib/rspec/rails/api/dsl/example_group.rb in rspec-rails-api-0.3.0 vs lib/rspec/rails/api/dsl/example_group.rb in rspec-rails-api-0.3.1
- old
+ new
@@ -72,15 +72,15 @@
metadata[:rrad].add_action(action, url, description)
describe("#{action.upcase} #{url}", &block)
end
- def for_code(status_code, description = nil, doc_only: false, &block)
+ def for_code(status_code, description = nil, doc_only: false, test_only: false, &block)
description ||= Rack::Utils::HTTP_STATUS_CODES[status_code]
- metadata[:rrad].add_status_code(status_code, description)
+ metadata[:rrad].add_status_code(status_code, description) unless test_only
- describe "-> #{status_code} - #{description}" do
+ describe "->#{test_only ? ' test' : ''} #{status_code} - #{description}" do
execute_for_code_block(status_code, doc_only, block)
end
end
private