{"action":"created","comment":{"url":"https://api.github.com/repos/Overbryd/flashcards/pulls/comments/40306283","id":40306283,"diff_hunk":"@@ -0,0 +1,85 @@\n+require_relative \"../test_helper.rb\"\n+\n+describe \"app\" do\n+\n+  before do\n+    ENV.delete(\"DECK\")\n+    reset_storage\n+  end\n+\n+  after do\n+    ENV.delete(\"DECK\")\n+    reset_storage\n+  end\n+\n+  describe \"GET /\" do\n+    before do\n+      @session = Session.new(deck_id: \"hiragana\")\n+      Session.stubs(:new).returns(@session)","path":"test/integration/app_test.rb","position":18,"original_position":18,"commit_id":"ed6ea7e4a6f99366eccb430ef5c5ef3e8fbdcf99","original_commit_id":"ed6ea7e4a6f99366eccb430ef5c5ef3e8fbdcf99","user":{"login":"Overbryd","id":21111,"avatar_url":"https://avatars.githubusercontent.com/u/21111?v=3","gravatar_id":"","url":"https://api.github.com/users/Overbryd","html_url":"https://github.com/Overbryd","followers_url":"https://api.github.com/users/Overbryd/followers","following_url":"https://api.github.com/users/Overbryd/following{/other_user}","gists_url":"https://api.github.com/users/Overbryd/gists{/gist_id}","starred_url":"https://api.github.com/users/Overbryd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Overbryd/subscriptions","organizations_url":"https://api.github.com/users/Overbryd/orgs","repos_url":"https://api.github.com/users/Overbryd/repos","events_url":"https://api.github.com/users/Overbryd/events{/privacy}","received_events_url":"https://api.github.com/users/Overbryd/received_events","type":"User","site_admin":false},"body":"* coupling and stubbing in this test\r\n\r\n    Yes, but for now that was quicker than maintaining something like a `Repository` or `Store` class that takes care of persistence of objects.\r\n\r\n    I generally like to start lean. For me that means I accepted a bit of coupling here and there. Usually I break out into more structures as the application grows.\r\n\r\n    For now we only need to persist one kind of object `Session` and therefore I feel totally fine stubbing around and keeping persistence code coupled to the `Session` class.\r\n\r\n* stubbing in the case of line 18 of this diff\r\n\r\n    I am stubbing `Session::new` to get hold on a session object ahead of time. So I can easily reference `@session.id` without having to worry how `Session#id` works.\r\n\r\n* how would a decoupled structure look like?\r\n\r\n    There would be a need for something that takes care of object persistence. Like a `Store` or `Repository`.\r\n\r\n    And later, I think it would make sense to decouple `Session#deck` from loading the deck directly into initialising the session with a Deck. That would start making sense to me whenever we explore different types of `Deck` and/or more user interaction with `Deck`. (e.g. choosing a different deck)","created_at":"2015-09-24T10:47:14Z","updated_at":"2015-09-24T10:47:14Z","html_url":"https://github.com/Overbryd/flashcards/pull/2#discussion_r40306283","pull_request_url":"https://api.github.com/repos/Overbryd/flashcards/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/Overbryd/flashcards/pulls/comments/40306283"},"html":{"href":"https://github.com/Overbryd/flashcards/pull/2#discussion_r40306283"},"pull_request":{"href":"https://api.github.com/repos/Overbryd/flashcards/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/Overbryd/flashcards/pulls/2","id":45673452,"html_url":"https://github.com/Overbryd/flashcards/pull/2","diff_url":"https://github.com/Overbryd/flashcards/pull/2.diff","patch_url":"https://github.com/Overbryd/flashcards/pull/2.patch","issue_url":"https://api.github.com/repos/Overbryd/flashcards/issues/2","number":2,"state":"open","locked":false,"title":"Step 3: Added Session::load and Session#save to accomplish persistence","user":{"login":"Overbryd","id":21111,"avatar_url":"https://avatars.githubusercontent.com/u/21111?v=3","gravatar_id":"","url":"https://api.github.com/users/Overbryd","html_url":"https://github.com/Overbryd","followers_url":"https://api.github.com/users/Overbryd/followers","following_url":"https://api.github.com/users/Overbryd/following{/other_user}","gists_url":"https://api.github.com/users/Overbryd/gists{/gist_id}","starred_url":"https://api.github.com/users/Overbryd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Overbryd/subscriptions","organizations_url":"https://api.github.com/users/Overbryd/orgs","repos_url":"https://api.github.com/users/Overbryd/repos","events_url":"https://api.github.com/users/Overbryd/events{/privacy}","received_events_url":"https://api.github.com/users/Overbryd/received_events","type":"User","site_admin":false},"body":"* Sessions are persistent, that means each time you start the app at \"/\"\r\n  you enter a new session.\r\n* Persistent sessions can be resumed\r\n* Added more tests, also some integration tests","created_at":"2015-09-22T14:54:56Z","updated_at":"2015-09-24T10:47:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0f3e3842aeb3f406b6e9f063ad72e282838f701d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Overbryd/flashcards/pulls/2/commits","review_comments_url":"https://api.github.com/repos/Overbryd/flashcards/pulls/2/comments","review_comment_url":"https://api.github.com/repos/Overbryd/flashcards/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Overbryd/flashcards/issues/2/comments","statuses_url":"https://api.github.com/repos/Overbryd/flashcards/statuses/ed6ea7e4a6f99366eccb430ef5c5ef3e8fbdcf99","head":{"label":"Overbryd:persistence","ref":"persistence","sha":"ed6ea7e4a6f99366eccb430ef5c5ef3e8fbdcf99","user":{"login":"Overbryd","id":21111,"avatar_url":"https://avatars.githubusercontent.com/u/21111?v=3","gravatar_id":"","url":"https://api.github.com/users/Overbryd","html_url":"https://github.com/Overbryd","followers_url":"https://api.github.com/users/Overbryd/followers","following_url":"https://api.github.com/users/Overbryd/following{/other_user}","gists_url":"https://api.github.com/users/Overbryd/gists{/gist_id}","starred_url":"https://api.github.com/users/Overbryd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Overbryd/subscriptions","organizations_url":"https://api.github.com/users/Overbryd/orgs","repos_url":"https://api.github.com/users/Overbryd/repos","events_url":"https://api.github.com/users/Overbryd/events{/privacy}","received_events_url":"https://api.github.com/users/Overbryd/received_events","type":"User","site_admin":false},"repo":{"id":42647543,"name":"flashcards","full_name":"Overbryd/flashcards","owner":{"login":"Overbryd","id":21111,"avatar_url":"https://avatars.githubusercontent.com/u/21111?v=3","gravatar_id":"","url":"https://api.github.com/users/Overbryd","html_url":"https://github.com/Overbryd","followers_url":"https://api.github.com/users/Overbryd/followers","following_url":"https://api.github.com/users/Overbryd/following{/other_user}","gists_url":"https://api.github.com/users/Overbryd/gists{/gist_id}","starred_url":"https://api.github.com/users/Overbryd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Overbryd/subscriptions","organizations_url":"https://api.github.com/users/Overbryd/orgs","repos_url":"https://api.github.com/users/Overbryd/repos","events_url":"https://api.github.com/users/Overbryd/events{/privacy}","received_events_url":"https://api.github.com/users/Overbryd/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Overbryd/flashcards","description":"","fork":false,"url":"https://api.github.com/repos/Overbryd/flashcards","forks_url":"https://api.github.com/repos/Overbryd/flashcards/forks","keys_url":"https://api.github.com/repos/Overbryd/flashcards/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Overbryd/flashcards/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Overbryd/flashcards/teams","hooks_url":"https://api.github.com/repos/Overbryd/flashcards/hooks","issue_events_url":"https://api.github.com/repos/Overbryd/flashcards/issues/events{/number}","events_url":"https://api.github.com/repos/Overbryd/flashcards/events","assignees_url":"https://api.github.com/repos/Overbryd/flashcards/assignees{/user}","branches_url":"https://api.github.com/repos/Overbryd/flashcards/branches{/branch}","tags_url":"https://api.github.com/repos/Overbryd/flashcards/tags","blobs_url":"https://api.github.com/repos/Overbryd/flashcards/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Overbryd/flashcards/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Overbryd/flashcards/git/refs{/sha}","trees_url":"https://api.github.com/repos/Overbryd/flashcards/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Overbryd/flashcards/statuses/{sha}","languages_url":"https://api.github.com/repos/Overbryd/flashcards/languages","stargazers_url":"https://api.github.com/repos/Overbryd/flashcards/stargazers","contributors_url":"https://api.github.com/repos/Overbryd/flashcards/contributors","subscribers_url":"https://api.github.com/repos/Overbryd/flashcards/subscribers","subscription_url":"https://api.github.com/repos/Overbryd/flashcards/subscription","commits_url":"https://api.github.com/repos/Overbryd/flashcards/commits{/sha}","git_commits_url":"https://api.github.com/repos/Overbryd/flashcards/git/commits{/sha}","comments_url":"https://api.github.com/repos/Overbryd/flashcards/comments{/number}","issue_comment_url":"https://api.github.com/repos/Overbryd/flashcards/issues/comments{/number}","contents_url":"https://api.github.com/repos/Overbryd/flashcards/contents/{+path}","compare_url":"https://api.github.com/repos/Overbryd/flashcards/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Overbryd/flashcards/merges","archive_url":"https://api.github.com/repos/Overbryd/flashcards/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Overbryd/flashcards/downloads","issues_url":"https://api.github.com/repos/Overbryd/flashcards/issues{/number}","pulls_url":"https://api.github.com/repos/Overbryd/flashcards/pulls{/number}","milestones_url":"https://api.github.com/repos/Overbryd/flashcards/milestones{/number}","notifications_url":"https://api.github.com/repos/Overbryd/flashcards/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Overbryd/flashcards/labels{/name}","releases_url":"https://api.github.com/repos/Overbryd/flashcards/releases{/id}","created_at":"2015-09-17T09:32:14Z","updated_at":"2015-09-17T09:32:21Z","pushed_at":"2015-09-23T11:30:29Z","git_url":"git://github.com/Overbryd/flashcards.git","ssh_url":"git@github.com:Overbryd/flashcards.git","clone_url":"https://github.com/Overbryd/flashcards.git","svn_url":"https://github.com/Overbryd/flashcards","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"Overbryd:master","ref":"master","sha":"985bdf755cc973076627a6d58d6e3a398fbe6dc4","user":{"login":"Overbryd","id":21111,"avatar_url":"https://avatars.githubusercontent.com/u/21111?v=3","gravatar_id":"","url":"https://api.github.com/users/Overbryd","html_url":"https://github.com/Overbryd","followers_url":"https://api.github.com/users/Overbryd/followers","following_url":"https://api.github.com/users/Overbryd/following{/other_user}","gists_url":"https://api.github.com/users/Overbryd/gists{/gist_id}","starred_url":"https://api.github.com/users/Overbryd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Overbryd/subscriptions","organizations_url":"https://api.github.com/users/Overbryd/orgs","repos_url":"https://api.github.com/users/Overbryd/repos","events_url":"https://api.github.com/users/Overbryd/events{/privacy}","received_events_url":"https://api.github.com/users/Overbryd/received_events","type":"User","site_admin":false},"repo":{"id":42647543,"name":"flashcards","full_name":"Overbryd/flashcards","owner":{"login":"Overbryd","id":21111,"avatar_url":"https://avatars.githubusercontent.com/u/21111?v=3","gravatar_id":"","url":"https://api.github.com/users/Overbryd","html_url":"https://github.com/Overbryd","followers_url":"https://api.github.com/users/Overbryd/followers","following_url":"https://api.github.com/users/Overbryd/following{/other_user}","gists_url":"https://api.github.com/users/Overbryd/gists{/gist_id}","starred_url":"https://api.github.com/users/Overbryd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Overbryd/subscriptions","organizations_url":"https://api.github.com/users/Overbryd/orgs","repos_url":"https://api.github.com/users/Overbryd/repos","events_url":"https://api.github.com/users/Overbryd/events{/privacy}","received_events_url":"https://api.github.com/users/Overbryd/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Overbryd/flashcards","description":"","fork":false,"url":"https://api.github.com/repos/Overbryd/flashcards","forks_url":"https://api.github.com/repos/Overbryd/flashcards/forks","keys_url":"https://api.github.com/repos/Overbryd/flashcards/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Overbryd/flashcards/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Overbryd/flashcards/teams","hooks_url":"https://api.github.com/repos/Overbryd/flashcards/hooks","issue_events_url":"https://api.github.com/repos/Overbryd/flashcards/issues/events{/number}","events_url":"https://api.github.com/repos/Overbryd/flashcards/events","assignees_url":"https://api.github.com/repos/Overbryd/flashcards/assignees{/user}","branches_url":"https://api.github.com/repos/Overbryd/flashcards/branches{/branch}","tags_url":"https://api.github.com/repos/Overbryd/flashcards/tags","blobs_url":"https://api.github.com/repos/Overbryd/flashcards/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Overbryd/flashcards/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Overbryd/flashcards/git/refs{/sha}","trees_url":"https://api.github.com/repos/Overbryd/flashcards/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Overbryd/flashcards/statuses/{sha}","languages_url":"https://api.github.com/repos/Overbryd/flashcards/languages","stargazers_url":"https://api.github.com/repos/Overbryd/flashcards/stargazers","contributors_url":"https://api.github.com/repos/Overbryd/flashcards/contributors","subscribers_url":"https://api.github.com/repos/Overbryd/flashcards/subscribers","subscription_url":"https://api.github.com/repos/Overbryd/flashcards/subscription","commits_url":"https://api.github.com/repos/Overbryd/flashcards/commits{/sha}","git_commits_url":"https://api.github.com/repos/Overbryd/flashcards/git/commits{/sha}","comments_url":"https://api.github.com/repos/Overbryd/flashcards/comments{/number}","issue_comment_url":"https://api.github.com/repos/Overbryd/flashcards/issues/comments{/number}","contents_url":"https://api.github.com/repos/Overbryd/flashcards/contents/{+path}","compare_url":"https://api.github.com/repos/Overbryd/flashcards/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Overbryd/flashcards/merges","archive_url":"https://api.github.com/repos/Overbryd/flashcards/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Overbryd/flashcards/downloads","issues_url":"https://api.github.com/repos/Overbryd/flashcards/issues{/number}","pulls_url":"https://api.github.com/repos/Overbryd/flashcards/pulls{/number}","milestones_url":"https://api.github.com/repos/Overbryd/flashcards/milestones{/number}","notifications_url":"https://api.github.com/repos/Overbryd/flashcards/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Overbryd/flashcards/labels{/name}","releases_url":"https://api.github.com/repos/Overbryd/flashcards/releases{/id}","created_at":"2015-09-17T09:32:14Z","updated_at":"2015-09-17T09:32:21Z","pushed_at":"2015-09-23T11:30:29Z","git_url":"git://github.com/Overbryd/flashcards.git","ssh_url":"git@github.com:Overbryd/flashcards.git","clone_url":"https://github.com/Overbryd/flashcards.git","svn_url":"https://github.com/Overbryd/flashcards","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Overbryd/flashcards/pulls/2"},"html":{"href":"https://github.com/Overbryd/flashcards/pull/2"},"issue":{"href":"https://api.github.com/repos/Overbryd/flashcards/issues/2"},"comments":{"href":"https://api.github.com/repos/Overbryd/flashcards/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/Overbryd/flashcards/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/Overbryd/flashcards/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Overbryd/flashcards/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/Overbryd/flashcards/statuses/ed6ea7e4a6f99366eccb430ef5c5ef3e8fbdcf99"}}}}