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

Feature/audit supplier #172

Open
wants to merge 22 commits into
base: development
Choose a base branch
from
Open

Feature/audit supplier #172

wants to merge 22 commits into from

Conversation

choonkeat
Copy link

Supersede #123

Audit supplier server is a rack app serving static jsons from spec/fixtures/audit

$ bundle exec rackup spec/fixtures/audit/config.ru
[2016-07-26 14:35:14] INFO  WEBrick 1.3.1
[2016-07-26 14:35:14] INFO  ruby 2.3.0 (2015-12-25) [x86_64-darwin14]
[2016-07-26 14:35:14] INFO  WEBrick::HTTPServer#start: pid=33023 port=9292

When request param property_id (quote, book) or reservation_number (cancel) is an error like connection_timeout, the rack server will respond accordingly to simulate the error. i.e. requests for a specific property or reservation will always get the same response.

Sync workers will hit a /spec/fixtures/audit/properties.json url, which serves a list of properties with property_id values from success, connection_timeout, ...

When consumers search and book, certain Audit properties (e.g. property_id: success) will always succeed; and certain Audit properties (depending on property_id) will always hit the same error.

When consumer try to cancel the booking, depending on the reference_number, the cancellation will always succeed or encounter an error

@@ -35,3 +35,7 @@ waytostay:
client_id: test_id
client_secret: test_secret

audit:
secret_key: <%= ENV.fetch('AUDIT_SECRET_KEY', 'test_secret') %>
host: http://localhost:9292
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't actually hit the servers on test, do we?

Copy link
Author

Choose a reason for hiding this comment

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

Nope, but the full YAML is here to put things through its paces

- connection_timeout
- invalid_json
- wrong_json
which returns an array of "fixtures/audit/property.json" with "identifier" being set to success, connection_timeout, etc ...
Otherwise, "base_currency = self.to_currency(base_currency)" becomes nil
Update PropertySynchronisation usage based on e1a33dd
@choonkeat
Copy link
Author

Rebased with development and added f142eed to catch up on the changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants