Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Credo powered improvements for monei #47

Merged
merged 6 commits into from
Dec 27, 2017
Merged

Credo powered improvements for monei #47

merged 6 commits into from
Dec 27, 2017

Conversation

oyeb
Copy link
Contributor

@oyeb oyeb commented Dec 24, 2017

  • Grouped tests using describe
  • Made stylisitic improvements as suggested by credo

`paymentId` -> `payment_id`
* I had missed a few `paymentId`s.
* Since #48 is merged, we can use full_name(). Coverage increased for
free :)
:delete -> HTTPoison.delete(url <> "?" <> URI.encode_query(auth_params)) |> respond
end
network_response = case method do
:post -> HTTPoison.post(url, {:form, body}, @default_headers)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oyeb we discussed formatting for this as per latest formatter code, make that change.

@@ -415,9 +416,10 @@ defmodule Gringotts.Gateways.Monei do
avs_result: [address: address, zip_code: zip_code],
raw: data]

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formatting for this should be something like

results = [
  code: code,
  description: result["description"],
]

end)
{:error, response} = Gateway.unstore("7214344252e11af79c0b9e7b4f3f6234", [config: auth])
assert response.code == :undefined_response_from_monei
describe "unstore |" do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove pipe here.

@pkrawat1 pkrawat1 removed the request for review from arjun289 December 27, 2017 11:01
* Fixed unstore test description
* Example cards will expire in 82 yrs :P
@pkrawat1 pkrawat1 merged commit 4306a89 into dev Dec 27, 2017
@pkrawat1 pkrawat1 deleted the monei-tests-credo branch December 27, 2017 13:07
pkrawat1 pushed a commit that referenced this pull request Dec 28, 2017
* Refactored code as suggested by credo

Closes #27

* Grouped tests using describe

* Better test descriptions

Removed the pipes and spaces

* Renamed ia CamelCase var.

`paymentId` -> `payment_id`

* Renamed missed CamelCase var, improves CC coverage

* I had missed a few `paymentId`s.
* Since #48 is merged, we can use full_name(). Coverage increased for
free :)

* Ran the elixir 1.6 formatter on Monei

* Fixed unstore test description
* Example cards will expire in 82 yrs :P
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants