{"action":"created","issue":{"url":"https://api.github.com/repos/openstreetmap/openstreetmap-website/issues/1570","repository_url":"https://api.github.com/repos/openstreetmap/openstreetmap-website","labels_url":"https://api.github.com/repos/openstreetmap/openstreetmap-website/issues/1570/labels{/name}","comments_url":"https://api.github.com/repos/openstreetmap/openstreetmap-website/issues/1570/comments","events_url":"https://api.github.com/repos/openstreetmap/openstreetmap-website/issues/1570/events","html_url":"https://github.com/openstreetmap/openstreetmap-website/issues/1570","id":239476304,"number":1570,"title":"Missing feature tests","user":{"login":"gravitystorm","id":360803,"avatar_url":"https://avatars2.githubusercontent.com/u/360803?v=3","gravatar_id":"","url":"https://api.github.com/users/gravitystorm","html_url":"https://github.com/gravitystorm","followers_url":"https://api.github.com/users/gravitystorm/followers","following_url":"https://api.github.com/users/gravitystorm/following{/other_user}","gists_url":"https://api.github.com/users/gravitystorm/gists{/gist_id}","starred_url":"https://api.github.com/users/gravitystorm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gravitystorm/subscriptions","organizations_url":"https://api.github.com/users/gravitystorm/orgs","repos_url":"https://api.github.com/users/gravitystorm/repos","events_url":"https://api.github.com/users/gravitystorm/events{/privacy}","received_events_url":"https://api.github.com/users/gravitystorm/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-06-29T13:20:07Z","updated_at":"2017-07-05T13:44:56Z","closed_at":"2017-07-05T13:44:56Z","body":"Our test suite is heavily focussed on controller and model tests. Unfortunately this means that very little of the site is actually tested, that is, very few of the tests render the views, or check that links are working and pointing in the right place etc. The controller tests don't render views, and each controller method is directly tested, rather than using the routes.\r\n\r\nThis means that problems crop up even though all the tests pass - see e.g. https://github.com/openstreetmap/openstreetmap-website/commit/117f0e82260efba3c6862e3aefa4b015b062a109\r\n\r\nThe advice I've read over the years is to focus less on controller tests, and more on feature tests - where a web browser is used to render the html, click on links etc. I find this works well in my other projects.\r\n\r\nI would suggest we do some or all of the following, but of course I'm open to suggestions:\r\n* Add feature tests to catch all the problems in the commit mentioned above\r\n* Ensure that the signup flow works using feature tests\r\n* Consider replacing the non-API, non-XML/RSS controller tests as feature tests"},"comment":{"url":"https://api.github.com/repos/openstreetmap/openstreetmap-website/issues/comments/313107205","html_url":"https://github.com/openstreetmap/openstreetmap-website/issues/1570#issuecomment-313107205","issue_url":"https://api.github.com/repos/openstreetmap/openstreetmap-website/issues/1570","id":313107205,"user":{"login":"gravitystorm","id":360803,"avatar_url":"https://avatars2.githubusercontent.com/u/360803?v=3","gravatar_id":"","url":"https://api.github.com/users/gravitystorm","html_url":"https://github.com/gravitystorm","followers_url":"https://api.github.com/users/gravitystorm/followers","following_url":"https://api.github.com/users/gravitystorm/following{/other_user}","gists_url":"https://api.github.com/users/gravitystorm/gists{/gist_id}","starred_url":"https://api.github.com/users/gravitystorm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gravitystorm/subscriptions","organizations_url":"https://api.github.com/users/gravitystorm/orgs","repos_url":"https://api.github.com/users/gravitystorm/repos","events_url":"https://api.github.com/users/gravitystorm/events{/privacy}","received_events_url":"https://api.github.com/users/gravitystorm/received_events","type":"User","site_admin":false},"created_at":"2017-07-05T13:44:56Z","updated_at":"2017-07-05T13:44:56Z","body":"> It's not true that controller tests don't render views by the way - they absolutely do.\r\n\r\nMy mistake. Minitest (and rails, by default) have different setup and naming to what I'm used to with RSpec.\r\n\r\nThe tests were added in fe1e28b4f45f6aa4bb53dc5163c187c5206b66a7 . I will make sure to add \"[system](http://guides.rubyonrails.org/testing.html#system-testing)\" tests instead of controller tests in future pull requests (e.g. `visit login_url`, `fill_in :email, :with => user.email` etc). But I won't keep this issue open here given there's no further specific actions required."}}
{"actor":{"display_login":"gravitystorm"}}