{"action":"opened","issue":{"url":"https://api.github.com/repos/htatche/nomadstays/issues/9","labels_url":"https://api.github.com/repos/htatche/nomadstays/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/htatche/nomadstays/issues/9/comments","events_url":"https://api.github.com/repos/htatche/nomadstays/issues/9/events","html_url":"https://github.com/htatche/nomadstays/issues/9","id":65226632,"number":9,"title":"Build tests for users authentication","user":{"login":"htatche","id":3421990,"avatar_url":"https://avatars.githubusercontent.com/u/3421990?v=3","gravatar_id":"","url":"https://api.github.com/users/htatche","html_url":"https://github.com/htatche","followers_url":"https://api.github.com/users/htatche/followers","following_url":"https://api.github.com/users/htatche/following{/other_user}","gists_url":"https://api.github.com/users/htatche/gists{/gist_id}","starred_url":"https://api.github.com/users/htatche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/htatche/subscriptions","organizations_url":"https://api.github.com/users/htatche/orgs","repos_url":"https://api.github.com/users/htatche/repos","events_url":"https://api.github.com/users/htatche/events{/privacy}","received_events_url":"https://api.github.com/users/htatche/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/htatche/nomadstays/labels/help%20wanted","name":"help wanted","color":"159818"}],"state":"open","locked":false,"assignee":{"login":"szines","id":1009783,"avatar_url":"https://avatars.githubusercontent.com/u/1009783?v=3","gravatar_id":"","url":"https://api.github.com/users/szines","html_url":"https://github.com/szines","followers_url":"https://api.github.com/users/szines/followers","following_url":"https://api.github.com/users/szines/following{/other_user}","gists_url":"https://api.github.com/users/szines/gists{/gist_id}","starred_url":"https://api.github.com/users/szines/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/szines/subscriptions","organizations_url":"https://api.github.com/users/szines/orgs","repos_url":"https://api.github.com/users/szines/repos","events_url":"https://api.github.com/users/szines/events{/privacy}","received_events_url":"https://api.github.com/users/szines/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/htatche/nomadstays/milestones/1","html_url":"https://github.com/htatche/nomadstays/milestones/Users","labels_url":"https://api.github.com/repos/htatche/nomadstays/milestones/1/labels","id":1043202,"number":1,"title":"Users","description":"Users are able to sign-up and login through our system and the social networks. We also give them a  public profile\r\n","creator":{"login":"htatche","id":3421990,"avatar_url":"https://avatars.githubusercontent.com/u/3421990?v=3","gravatar_id":"","url":"https://api.github.com/users/htatche","html_url":"https://github.com/htatche","followers_url":"https://api.github.com/users/htatche/followers","following_url":"https://api.github.com/users/htatche/following{/other_user}","gists_url":"https://api.github.com/users/htatche/gists{/gist_id}","starred_url":"https://api.github.com/users/htatche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/htatche/subscriptions","organizations_url":"https://api.github.com/users/htatche/orgs","repos_url":"https://api.github.com/users/htatche/repos","events_url":"https://api.github.com/users/htatche/events{/privacy}","received_events_url":"https://api.github.com/users/htatche/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":4,"state":"open","created_at":"2015-03-28T23:21:57Z","updated_at":"2015-03-30T14:36:05Z","due_on":"2015-04-05T04:00:00Z","closed_at":null},"comments":0,"created_at":"2015-03-30T14:36:04Z","updated_at":"2015-03-30T14:36:04Z","closed_at":null,"body":"The user registration and sign-in process is done, we can already write the tests for it.\r\n\r\nUsers can either create an account through our website, or use Google+ or Twitter for that purpose. Since Twitter doesn't provide an email through the OAuth callback (see the provided hash [here](https://github.com/arunagw/omniauth-twitter)), we don't have the emails of our Twitter users. It is not a problem since we can just ask them to update their email once they want to make a booking.  \r\n\r\n To make things easier, we do have a model called ```Identity```, which contains the information we get through the OAuth callback when a user registers with a social network account. ```Identity``` is linked to ```User```, which is the only one used when a user just registers using our normal form.\r\n\r\nHave a look at ```OmniauthCallbacksController```, which contains a generic method to handle the callback for both Twitter and Google+ (can be easily extended to other ones further on)\r\n\r\nAlso, when login through a social network the user does not provide a password, so I have removed ```:validable``` from the ```User``` Devise options, and instead we use the model ```FormUser``` to validate the normal form registrations.\r\n\r\nI suggest that we first decide how are we going to build our testing environment in #8, and we can then proceed to discuss how to write the first tests of our website, starting with the users registration and authentication."}}