-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This will be handle manually by them.
- Loading branch information
Showing
3 changed files
with
46 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,37 +62,37 @@ def test_valid_webhook_request_cocagne | |
}.to_json | ||
end | ||
|
||
def test_valid_webhook_request_locali | ||
ENV["LOCALI_API_TOKEN"] = "api-token-locali" | ||
payload = File.read('test/fixtures/order_completed_locali.json') | ||
stub_request(:any, "https://admin.panier-locali.test/api/v1/members") | ||
.to_return(status: 201) | ||
|
||
request(payload) | ||
|
||
assert_equal 204, last_response.status | ||
assert_empty last_response.body | ||
|
||
assert_requested :post, "https://admin.panier-locali.test/api/v1/members", | ||
times: 1, | ||
headers: { | ||
"Content-Type" => "application/json", | ||
"Authorization" => "Token token=api-token-locali" | ||
}, | ||
body: { | ||
name: "Doe John", | ||
emails: "[email protected]", | ||
phones: "0791234567", | ||
address: "Chemin de la Mairie 1", | ||
city: "Genève", | ||
zip: "1205", | ||
country_code: "CH", | ||
note: "Commande locali-ge.ch #35717", | ||
waiting_basket_size_id: 1, | ||
waiting_depot_id: 3, | ||
members_basket_complements_attributes: [] | ||
}.to_json | ||
end | ||
# def test_valid_webhook_request_locali | ||
# ENV["LOCALI_API_TOKEN"] = "api-token-locali" | ||
# payload = File.read('test/fixtures/order_completed_locali.json') | ||
# stub_request(:any, "https://admin.panier-locali.test/api/v1/members") | ||
# .to_return(status: 201) | ||
|
||
# request(payload) | ||
|
||
# assert_equal 204, last_response.status | ||
# assert_empty last_response.body | ||
|
||
# assert_requested :post, "https://admin.panier-locali.test/api/v1/members", | ||
# times: 1, | ||
# headers: { | ||
# "Content-Type" => "application/json", | ||
# "Authorization" => "Token token=api-token-locali" | ||
# }, | ||
# body: { | ||
# name: "Doe John", | ||
# emails: "[email protected]", | ||
# phones: "0791234567", | ||
# address: "Chemin de la Mairie 1", | ||
# city: "Genève", | ||
# zip: "1205", | ||
# country_code: "CH", | ||
# note: "Commande locali-ge.ch #35717", | ||
# waiting_basket_size_id: 1, | ||
# waiting_depot_id: 3, | ||
# members_basket_complements_attributes: [] | ||
# }.to_json | ||
# end | ||
|
||
def test_valid_webhook_request_touviere | ||
ENV["TOUVIERE_API_TOKEN"] = "api-token-touviere" | ||
|