spec/lib/myfinance/resources/payable_account_spec.rb in myfinance-1.6.3 vs spec/lib/myfinance/resources/payable_account_spec.rb in myfinance-1.6.4
- old
+ new
@@ -142,11 +142,11 @@
expect { subject }.to raise_error(request_error)
end
it "adds information on request error object" do
body = { "competency_month" => ["não pode ser vazio"], "due_date" => ["não é uma data válida"] }
- expect(request_error).to receive(:new).with(code: 422, message: "", body: body).and_call_original
+ expect(request_error).to receive(:new).with(code: 422, message: "", body: body, headers: instance_of(Typhoeus::Response::Header)).and_call_original
expect { subject }.to raise_error(request_error)
end
end
context "when entity does not exist" do
@@ -156,10 +156,10 @@
expect { subject }.to raise_error(request_error)
end
it "adds information on request error object" do
body = {"error" => "Você não tem permissão para acessar este recurso." }
- expect(request_error).to receive(:new).with(code: 403, message: "Forbidden", body: body).and_call_original
+ expect(request_error).to receive(:new).with(code: 403, message: "Forbidden", body: body, headers: instance_of(Typhoeus::Response::Header)).and_call_original
expect { subject }.to raise_error(request_error)
end
end
end