Module: RSpecApi::Matchers::ContentType
- Included in:
- RSpecApi::Matchers
- Defined in:
- lib/rspec-api/matchers/content_type/matcher.rb,
lib/rspec-api/matchers/content_type/have_content_type.rb
Defined Under Namespace
Classes: Matcher
Instance Method Summary collapse
-
#have_content_type(type = nil) ⇒ Object
Passes if the object includes the expected content type in the headers.
Instance Method Details
#have_content_type(type = nil) ⇒ Object
Passes if the object includes the expected content type in the headers.
26 27 28 29 30 31 32 33 |
# File 'lib/rspec-api/matchers/content_type/have_content_type.rb', line 26 def have_content_type(type = nil) content_type = case type when :json then 'application/json; charset=utf-8' when :any then %r{} else type end RSpecApi::Matchers::ContentType::Matcher.new content_type end |