{"action":"created","issue":{"url":"https://api.github.com/repos/education/classroom/issues/508","repository_url":"https://api.github.com/repos/education/classroom","labels_url":"https://api.github.com/repos/education/classroom/issues/508/labels{/name}","comments_url":"https://api.github.com/repos/education/classroom/issues/508/comments","events_url":"https://api.github.com/repos/education/classroom/issues/508/events","html_url":"https://github.com/education/classroom/pull/508","id":142125231,"number":508,"title":"Autocomplete for starter code repo","user":{"login":"cyhsutw","id":1046917,"avatar_url":"https://avatars.githubusercontent.com/u/1046917?v=3","gravatar_id":"","url":"https://api.github.com/users/cyhsutw","html_url":"https://github.com/cyhsutw","followers_url":"https://api.github.com/users/cyhsutw/followers","following_url":"https://api.github.com/users/cyhsutw/following{/other_user}","gists_url":"https://api.github.com/users/cyhsutw/gists{/gist_id}","starred_url":"https://api.github.com/users/cyhsutw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cyhsutw/subscriptions","organizations_url":"https://api.github.com/users/cyhsutw/orgs","repos_url":"https://api.github.com/users/cyhsutw/repos","events_url":"https://api.github.com/users/cyhsutw/events{/privacy}","received_events_url":"https://api.github.com/users/cyhsutw/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/education/classroom/labels/ready%20for%20review","name":"ready for review","color":"E96C5A"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2016-03-20T03:33:47Z","updated_at":"2016-03-25T13:13:06Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/education/classroom/pulls/508","html_url":"https://github.com/education/classroom/pull/508","diff_url":"https://github.com/education/classroom/pull/508.diff","patch_url":"https://github.com/education/classroom/pull/508.patch"},"body":"Hello guys,\r\n\r\nThis should fix #480. \r\n\r\nHere's a short demo:\r\n\r\n![autocomplete](https://cloud.githubusercontent.com/assets/1046917/13902654/f6529286-ee8b-11e5-80d8-91874d8db628.gif)\r\n\r\n- By default, it shows the repositories that the user can access using the [list your repos API](https://developer.github.com/v3/repos/#list-your-repositories).\r\n- Or, if the user put type some string like `education/t`, it will search the the repositories under namespace education (in this case, it will show `education/teachers_pet` and `education/teachers`).\r\n- It utilizes the [repository search API](https://developer.github.com/v3/search/#search-repositories) directly for other queries like `rails`.\r\n\r\n### Issues with Testing\r\n\r\nPreviously, I have the `AutocompleteController` generate JSON responses and use CoffeeScript to create suggestion elements.\r\nAfter digging into the code base, I found using the `render_partial` might be more extensible for future additions like searching `users`.\r\n\r\nAfter this change, it becomes hard to write tests since we will deal with the HTML contents which is relatively harder to validate.\r\n\r\nOne possible solution is making the controller support both HTML and JSON and the tests will check the JSON responses instead of HTML responses. \r\n\r\nIs there any good way to make the `AutocompleteController` more testable?\r\n\r\n------\r\n\r\nI would love to participate GSoC 2016 and this is my first PR for the Classroom. I would be very grateful if you can provide any advice/feedback :smile: \r\n\r\nThank you!"},"comment":{"url":"https://api.github.com/repos/education/classroom/issues/comments/201272773","html_url":"https://github.com/education/classroom/pull/508#issuecomment-201272773","issue_url":"https://api.github.com/repos/education/classroom/issues/508","id":201272773,"user":{"login":"cyhsutw","id":1046917,"avatar_url":"https://avatars.githubusercontent.com/u/1046917?v=3","gravatar_id":"","url":"https://api.github.com/users/cyhsutw","html_url":"https://github.com/cyhsutw","followers_url":"https://api.github.com/users/cyhsutw/followers","following_url":"https://api.github.com/users/cyhsutw/following{/other_user}","gists_url":"https://api.github.com/users/cyhsutw/gists{/gist_id}","starred_url":"https://api.github.com/users/cyhsutw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cyhsutw/subscriptions","organizations_url":"https://api.github.com/users/cyhsutw/orgs","repos_url":"https://api.github.com/users/cyhsutw/repos","events_url":"https://api.github.com/users/cyhsutw/events{/privacy}","received_events_url":"https://api.github.com/users/cyhsutw/received_events","type":"User","site_admin":false},"created_at":"2016-03-25T13:13:06Z","updated_at":"2016-03-25T13:13:06Z","body":"@tarebyte Thanks for the explanation! :smile: \r\n\r\n"}}