spec/request_drivers/curb_spec.rb in api-auth-1.4.0 vs spec/request_drivers/curb_spec.rb in api-auth-1.4.1

- old
+ new

@@ -64,13 +64,21 @@ end end describe "#set_date" do - it "sets the date" do + before do allow(Time).to receive_message_chain(:now, :utc, :httpdate).and_return(timestamp) + end + + it "sets the date header of the request" do driven_request.set_date expect(request.headers['DATE']).to eq(timestamp) + end + + it "refreshes the cached headers" do + driven_request.set_date + expect(driven_request.timestamp).to eq(timestamp) end end describe "#set_auth_header" do it "sets the auth header" do