forked from thesuss/shf-project
-
Notifications
You must be signed in to change notification settings - Fork 38
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
Validate dinkurs key with Dinkurs API #540
Merged
patmbolger
merged 13 commits into
AgileVentures:develop
from
patmbolger:dinkurs_key_validation#158426458
Jun 24, 2018
Merged
Validate dinkurs key with Dinkurs API #540
patmbolger
merged 13 commits into
AgileVentures:develop
from
patmbolger:dinkurs_key_validation#158426458
Jun 24, 2018
Conversation
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
houndci-bot
reviewed
Jun 21, 2018
spec/models/company_spec.rb
Outdated
result = company.validate_key_and_fetch_dinkurs_events | ||
|
||
expect(result).to eq false | ||
expect(company.errors.full_messages.first).to match /#{err}/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lint/AmbiguousRegexpLiteral: Ambiguous regexp literal. Parenthesize the method arguments if it's surely a regexp literal, or add a whitespace to the right of the / if it should be a division.
ef7564d
to
13645d7
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PT Story: https://www.pivotaltracker.com/story/show/158426458
Validation of the
dinkurs_company_key
attribute is complicated by these factors:• We need to invoke the "fetch" API in order to determine if we have a valid key (that is, there is not a separate endpoint we could use to simply check key validity without fetching events)
• We want to avoid calling that API end point more than once, since it is called synchronously (which is the only reasonable way to do it)
• To fetch and store company events, we need a company ID
• Therefore, we need to fetch events after the company has been saved (for create)
Changes proposed in this pull request:
Screenshots (Optional):
Company created successful, but dinkurs key is invalid
Company updated with invalid dinkurs key
Ready for review:
@AgileVentures/shf-project-team