spec/http_spec.rb in opal-jquery-0.4.1 vs spec/http_spec.rb in opal-jquery-0.4.2
- old
+ new
@@ -76,6 +76,20 @@
HTTP.get(bad_url) do |response|
async { expect(response).to_not be_ok }
end
end
end
+
+ describe '#get_header' do
+ async 'returns the header value' do
+ HTTP.get(good_url) do |response|
+ async { expect(response.get_header 'Content-Type').to eq 'text/plain' }
+ end
+ end
+
+ async 'returns nil' do
+ HTTP.get(good_url) do |response|
+ async { expect(response.get_header 'Does-Not-Exist').to be nil }
+ end
+ end
+ end
end