spec/lib/myfinance/resources/payable_account_spec.rb in myfinance-0.2.0 vs spec/lib/myfinance/resources/payable_account_spec.rb in myfinance-0.3.0

- old
+ new

@@ -64,11 +64,11 @@ it "raises Myfinance::RequestError" do expect { subject }.to raise_error(Myfinance::RequestError) end it "adds information on request error object" do - expect(Myfinance::RequestError).to receive(:new).with(code: 422, message: "", body: "{\"competency_month\":[\"n\\u00e3o pode ser vazio\"],\"due_date\":[\"n\\u00e3o \\u00e9 uma data v\\u00e1lida\"]}").and_call_original + expect(Myfinance::RequestError).to receive(:new).with(code: 422, message: "", body: { "competency_month" => ["não pode ser vazio"], "due_date" => ["não é uma data válida"] }).and_call_original expect { subject }.to raise_error(Myfinance::RequestError) end end context "when entity does not exist" do @@ -77,10 +77,10 @@ it "raises Myfinance::RequestError" do expect { subject }.to raise_error(Myfinance::RequestError) end it "adds information on request error object" do - expect(Myfinance::RequestError).to receive(:new).with(code: 403, message: "Forbidden", body: "{\"error\":\"Voc\\u00ea n\\u00e3o tem permiss\\u00e3o para acessar este recurso.\"}").and_call_original + expect(Myfinance::RequestError).to receive(:new).with(code: 403, message: "Forbidden", body: {"error" => "Você não tem permissão para acessar este recurso." }).and_call_original expect { subject }.to raise_error(Myfinance::RequestError) end end end