-
Notifications
You must be signed in to change notification settings - Fork 12
Add new endpoint to search users #25
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
Open
leahsteinberg
wants to merge
6
commits into
master
Choose a base branch
from
ls/search_users_endpoint
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
8f68bb4
in progress, adding search users endpoint
bb3b927
in progress, making tests
9a1a7b8
work in progress, adding tests
4df01c4
Gets search users and passes two tests
8fa9237
Pass integration tests that ensure the endpoint returns VENUser objec…
246f886
trying to pull master
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
{"data": [{"username": "johnjohnny", "first_name": "John", "last_name": "Johnny", "display_name": "John Johnny", "about": "Super cool", "profile_picture_url": "https://s3.amazonaws.com/venmo/no-image.gif", "id": "357916301328384538", "date_joined": "2010-05-09T19:55:48"}, {"username": "ian-john", "first_name": "Ian", "last_name": "John", "display_name": "Ian John", "about": "No Short Bio", "profile_picture_url": "https://venmopics.appspot.com/u/v1/s/7472351c-5048-43d2-b355-783cc8ddccc3", "id": "1119050902011904420", "date_joined": "2013-03-24T23:54:23"}, {"username": "fred-iwan", "first_name": "Fred", "last_name": "Iwan", "display_name": "Fred Iwan", "about": "No Short Bio", "profile_picture_url": "https://venmopics.appspot.com/u/v1/f/0061894e-ae49-432f-b71c-5d2c8a90af8c", "id": "1181135426027520752", "date_joined": "2013-06-18T15:45:15"}, {"username": "wojtek-iwan", "first_name": "Wojtek", "last_name": "Iwan", "display_name": "Wojtek Iwan", "about": "No Short Bio", "profile_picture_url": "https://s3.amazonaws.com/venmo/no-image.gif", "id": "1424746868637696006", "date_joined": "2014-05-20T18:37:42"}, {"username": "iwan-dodd", "first_name": "Iwan", "last_name": "Dodd", "display_name": "Iwan Dodd", "about": "No Short Bio", "profile_picture_url": "https://s3.amazonaws.com/venmo/no-image.gif", "id": "1321719184752640008", "date_joined": "2013-12-29T15:00:05"}, {"username": "iwan-vandervinne", "first_name": "Iwan", "last_name": "Vandervinne", "display_name": "Iwan Vandervinne", "about": "No Short Bio", "profile_picture_url": "https://s3.amazonaws.com/venmo/no-image.gif", "id": "1401122828845056083", "date_joined": "2014-04-18T04:20:57"}, {"username": "iwan-nyotowidjojo", "first_name": "Iwan", "last_name": "Nyotowidjojo", "display_name": "Iwan Nyotowidjojo", "about": "No Short Bio", "profile_picture_url": "https://venmopics.appspot.com/u/v1/s/82ed1fe4-1370-4af8-a50e-8c07b4ee639f", "id": "1412014085767168711", "date_joined": "2014-05-03T04:59:56"}, {"username": "iain-macneill", "first_name": "Iain", "last_name": "Macneill", "display_name": "Iain Macneill", "about": "No Short Bio", "profile_picture_url": "https://s3.amazonaws.com/venmo/no-image.gif", "id": "584921714262016599", "date_joined": "2011-03-19T00:55:02"}, {"username": "iain-edminster", "first_name": "Iain", "last_name": "Edminster", "display_name": "Iain Edminster", "about": "No Short Bio", "profile_picture_url": "https://venmopics.appspot.com/u/v1/s/e8d56419-dc3b-4507-901a-2b13f0a00878", "id": "952159050924033016", "date_joined": "2012-08-06T17:30:04"}, {"username": "iain-christenson", "first_name": "Iain", "last_name": "Christenson", "display_name": "Iain Christenson", "about": "No Short Bio", "profile_picture_url": "https://graph.facebook.com/760153964/picture?type=square", "id": "1337762254946305010", "date_joined": "2014-01-20T18:14:48"}, {"username": "iain-cockshott", "first_name": "Iain", "last_name": "Cockshott", "display_name": "Iain Cockshott", "about": "No Short Bio", "profile_picture_url": "https://s3.amazonaws.com/venmo/no-image.gif", "id": "1317372979838976810", "date_joined": "2013-12-23T15:04:57"}, {"username": "iain-griffiths", "first_name": "Iain", "last_name": "Griffiths", "display_name": "Iain Griffiths", "about": "No Short Bio", "profile_picture_url": "https://s3.amazonaws.com/venmo/no-image.gif", "id": "1204272582623232024", "date_joined": "2013-07-20T13:54:39"}, {"username": "iain-saunderson", "first_name": "Iain", "last_name": "Saunderson", "display_name": "Iain Saunderson", "about": " ", "profile_picture_url": "https://graph.facebook.com/602218352/picture?type=square", "id": "1437851124236288685", "date_joined": "2014-06-07T20:33:31"}, {"username": "iain-marrs", "first_name": "Iain ", "last_name": "Marrs", "display_name": "Iain Marrs", "about": "No Short Bio", "profile_picture_url": "https://s3.amazonaws.com/venmo/no-image.gif", "id": "1442080744275968454", "date_joined": "2014-06-13T16:37:01"}, {"username": "iain-zautner", "first_name": "Iain", "last_name": "Zautner", "display_name": "Iain Zautner", "about": "No Short Bio", "profile_picture_url": "https://venmopics.appspot.com/u/v1/s/4ff3c610-a54c-4af6-9ecc-a0f05170bd3d", "id": "1262519477862400113", "date_joined": "2013-10-08T22:40:50"}, {"username": "iain-starr", "first_name": "Iain", "last_name": "Starr", "display_name": "Iain Starr", "about": "No Short Bio", "profile_picture_url": "https://s3.amazonaws.com/venmo/no-image.gif", "id": "1246383579332608233", "date_joined": "2013-09-16T16:21:41"}, {"username": "iain-macdonald", "first_name": "Iain", "last_name": "Macdonald", "display_name": "Iain Macdonald", "about": "No Short Bio", "profile_picture_url": "https://s3.amazonaws.com/venmo/no-image.gif", "id": "1465680054452224192", "date_joined": "2014-07-16T06:04:38"}, {"username": "iain-denham", "first_name": "Iain", "last_name": "Denham", "display_name": "Iain Denham", "about": "No Short Bio", "profile_picture_url": "https://graph.facebook.com/10703485/picture?type=square", "id": "1366773509128192389", "date_joined": "2014-03-01T18:54:59"}, {"username": "iain-mcdonald", "first_name": "Iain", "last_name": "Mcdonald", "display_name": "Iain Mcdonald", "about": "No Short Bio", "profile_picture_url": "https://s3.amazonaws.com/venmo/no-image.gif", "id": "1369164547620864354", "date_joined": "2014-03-05T02:05:33"}, {"username": "iain-proctor", "first_name": "Iain", "last_name": "Proctor", "display_name": "Iain Proctor", "about": "No Short Bio", "profile_picture_url": "https://s3.amazonaws.com/venmo/no-image.gif", "id": "1408403142344704509", "date_joined": "2014-04-28T05:25:38"}]} |
This file contains hidden or 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 |
---|---|---|
|
@@ -252,4 +252,37 @@ | |
|
||
}); | ||
|
||
|
||
describe(@"SearchUsersWithSearchQuery", ^{ | ||
it(@"should fetch users with search string 'john'", ^AsyncBlock{ | ||
NSString *query = @"john"; | ||
NSString *baseURLString = [VENTestUtilities baseURLStringForCore:[VENCore defaultCore]]; | ||
NSString *urlToStub = [NSString stringWithFormat:@"%@/users?query=%@", baseURLString, query]; | ||
[VENTestUtilities stubNetworkGET:urlToStub withStatusCode:200 andResponseFilePath:@"searchUsers"]; | ||
[VENUser searchUsersWithQuery:query success:^(NSArray *users) { | ||
expect([users count]).to.equal(@(20)); | ||
done(); | ||
|
||
}failure:^(NSError *error) { | ||
XCTFail(); | ||
done(); | ||
}]; | ||
}); | ||
|
||
it(@"should return 20 users when given an empy string search query", ^AsyncBlock{ | ||
NSString *query = @""; | ||
NSString *baseURLString = [VENTestUtilities baseURLStringForCore:[VENCore defaultCore]]; | ||
NSString *urlToStub = [NSString stringWithFormat:@"%@/users?query=%@", baseURLString, query]; | ||
[VENTestUtilities stubNetworkGET:urlToStub withStatusCode:200 andResponseFilePath:@"searchUsers"]; | ||
[VENUser searchUsersWithQuery:query success:^(NSArray *users) { | ||
expect([users count]).to.equal(@(20)); | ||
done(); | ||
}failure:^(NSError *error) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. } failure:^(NSError *error) { |
||
XCTFail(); | ||
done(); | ||
}]; | ||
}); | ||
}); | ||
|
||
|
||
SpecEnd |
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.
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.