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
Adds tests for search api methods responses Fixes #1418 #1437
Adds tests for search api methods responses Fixes #1418 #1437
Conversation
Generated by 🚫 Danger |
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.
Thanks for your contribution and sorry for responding a little slow! We're very grateful for your work -- just a few requests before it's quite ready to merge in. Happy to help you through these steps!
|
||
matcher = JsonExpressions::Matcher.new(pattern) | ||
|
||
json = JSON.parse(last_response.body) |
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.
Hi, here, we'd want to search for a profile, not "Blog" - so we could change get '/api/srch/profiles?srchString=Blog'
to get '/api/srch/profiles?srchString=Bob' (working from the test data in
/test/fixtures/users.yml`).
Then, as done above on these lines, we can test the returned data. In this case, we'd want to check that the returned data is the record for "Bob". We could make an educated guess but maybe the best would be to start by inserting a logging action to see what the contents are:
puts json['items'][0]
Once we know exactly what it returns, we can adjust the test to confirm that. Does this make sense?
@@ -1,31 +1,31 @@ | |||
GEM | |||
remote: https://rubygems.org/ | |||
specs: | |||
actionmailer (3.2.22.4) | |||
actionpack (= 3.2.22.4) | |||
actionmailer (3.2.22.5) |
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.
So, here, we don't really want to submit a new Gemfile.lock
-- do you think you could remove that file from the commit using this guide? https://stackoverflow.com/questions/215718/reset-or-revert-a-specific-file-to-a-specific-revision-using-git
@jywarren, This kind of work could fall under the planning issue I just put in to day, Issue #1449 if you want an overarching guide to this kind of work. @mlendale, if you enjoy the work on the RESTful services and @jywarren agrees, I'd like to invite you to keep adding more work under Issue #1449. For Phase 1, I'm adding the Swagger UI to the plots2 code as an initial documentation, testing, and learning tool. Then it's more of the work you've done here. |
Hi, just a check in if you could use any help with this one! |
I definitely missed your comments. They all make sense, of course. Doing it
ASAP. Sorry for the delay.
2017-06-13 0:24 GMT+02:00 Jeffrey Warren <notifications@github.com>:
… Hi, just a check in if you could use any help with this one!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1437 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AJ_54MYz1UkvJQut9VqmBBgG4uma7vadks5sDbqVgaJpZM4Nn1w5>
.
|
No problem at all! Thanks and no huge rush but we're here to help if you
have questions.
…On Jun 12, 2017 6:48 PM, "mlendale" ***@***.***> wrote:
I definitely missed your comments. They all make sense, of course. Doing it
ASAP. Sorry for the delay.
2017-06-13 0:24 GMT+02:00 Jeffrey Warren ***@***.***>:
> Hi, just a check in if you could use any help with this one!
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#1437 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AJ_
54MYz1UkvJQut9VqmBBgG4uma7vadks5sDbqVgaJpZM4Nn1w5>
> .
>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1437 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABfJ_nvzb998FQPuSxHx-QwG1FRl6cbks5sDcAdgaJpZM4Nn1w5>
.
|
# Expected search pattern | ||
pattern = { | ||
srchParams: { | ||
srchString: 'Blog', |
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.
And here, there's probably not a question with the search string "Blog" -- but check the fixtures data in /test/fixtures/nodes.yml
and see what search term would be appropriate for a questions search. Thanks!
# Expected search pattern | ||
pattern = { | ||
srchParams: { | ||
srchString: 'Blog', |
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.
And here, check out /test/fixtures/tags.yml
for a tag to search for, so that it returns at least one result.
Hi! I think I'm going to close this one up as we haven't heard back -- but we're still very interested in helping you get involved if you'd like! We have a new welcoming page and a whole lot of good issues up for grabs -- and ready to offer guidance if you need it. Thank you!! |
Fixes #1418
This change is