spec/middleware/request_headers_spec.rb in faraday-conductivity-0.3.0 vs spec/middleware/request_headers_spec.rb in faraday-conductivity-0.3.1
- old
+ new
@@ -1,17 +1,15 @@
-require "spec_helper"
+RSpec.describe Faraday::Conductivity::RequestHeaders do
-describe Faraday::Conductivity::RequestHeaders do
-
it "includes the mimetype specified" do
connection = create_connection do |faraday|
faraday.request :request_headers, :accept => "application/json", :x_version_number => "123"
end
request_headers = connection.get("/test").env[:request_headers]
- request_headers["Accept"].should eq "application/json"
- request_headers["X-Version-Number"].should eq "123"
+ expect(request_headers["Accept"]).to eq "application/json"
+ expect(request_headers["X-Version-Number"]).to eq "123"
end
it "doesn't override locally specified headers" do
connection = create_connection do |faraday|
faraday.request :request_headers, :accept => "application/json"
@@ -20,9 +18,9 @@
request.headers[:accept] = "application/xml"
end
request_headers = response.env[:request_headers]
- request_headers["Accept"].should eq "application/xml"
+ expect(request_headers["Accept"]).to eq "application/xml"
end
end