-
Notifications
You must be signed in to change notification settings - Fork 26
chore: adjust parameters for search_content()
#455
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
Conversation
tests/testthat/test-content.R
Outdated
| # This test also confirms the behavior that page_number is passed down via | ||
| # ..., even though this isn't behavior we *require*. |
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.
Nice comment explaining why we're testing this thing and that it's not that we believe that page_number is useful, just that it's something that will be passed down.
An alternative (that honestly might not be better! I'm meh about it) would be to use a random extra named argument here. Since we're just asserting expect_GET we just need to confirm the argument is dutifully passed down. But it would require a similar note "We are calling this with not_a_param which isn't a query parameter in the real API to ensure that we are passing unknown args through ... to the query itself.
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.
We already have such a test on line 525! :)
I guess… I put this separate test in because page_number is a named param in the inner function, rather than something that just gets incidentally passed down in via ....
I'll remove this test. I don't think the other test needs a similar note because the test name makes it clear what it's doing.
test_that("content search passes arbitrary parameters through ... to query string", {
without_internet(
expect_GET(
search_content(
client,
q = "bream",
future_param = "value"
),
"https://connect.example/__api__/v1/search/content?q=bream&page_number=1&page_size=500&include=owner%2Cvanity_url&future_param=value" #nolint
)
)
})(Lmk if I misunderstood what you're saying!)
karawoo
left a comment
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.
took us all a minute to get on the same page, but I feel good about this.
Intent
Adjust parameters in
search_content()page_size(query param) andlimit(page_offset()arg) insearch_content()args following pattern elsewhere inconnectapi.page_number; note the behavior in...documentation....and ensure it gets added to the query string.Fixes #450
Approach
Checklist
NEWS.md(referencing the connected issue if necessary)?devtools::document()?