{"action":"created","comment":{"url":"https://api.github.com/repos/yahoo/fluxible.io/pulls/comments/24186246","id":24186246,"diff_hunk":"@@ -0,0 +1,76 @@\n+/* global describe, it, before */\n+'use strict';\n+var expect = require('chai').expect;\n+var MockContext = require('fluxible/utils/MockActionContext')();\n+var MockService = require('fluxible-plugin-fetchr/utils/MockServiceManager');\n+var DocStore = require('../../../stores/DocStore');\n+var showDoc = require('../../../actions/showDoc');\n+var docResponse = require('../../fixtures/doc-response.json');\n+\n+MockContext.Dispatcher.registerStore(DocStore);\n+\n+describe('controller actions', function () {\n+    var context;\n+\n+    before(function () {\n+        context = new MockContext();\n+        context.service = new MockService();\n+        context.service.setService('docs', function (method, params, config, callback) {\n+            if (params.emulateError) {\n+                return callback(new Error('Things went sour.'));\n+            }\n+\n+            callback(null, docResponse);\n+        });\n+    });\n+\n+    it('should load data from the service', function (done) {\n+        var params = {\n+            resource: 'docs',\n+            key: '/docs/quick-start.md'\n+        };\n+\n+        context.executeAction(showDoc, params, function (err) {\n+            if (err) {\n+                return done(err);\n+            }\n+\n+            var docs = context.getStore(DocStore).getAll();\n+            expect(docs).to.be.an('object');","path":"tests/unit/actions/showDoc.js","position":39,"original_position":39,"commit_id":"8ce033b8ab65c602878f1fe7f7c6669774bb445a","original_commit_id":"53a4e81362113aa050506a6b116e2d90b31b77cc","user":{"login":"jedireza","id":979929,"avatar_url":"https://avatars.githubusercontent.com/u/979929?v=3","gravatar_id":"","url":"https://api.github.com/users/jedireza","html_url":"https://github.com/jedireza","followers_url":"https://api.github.com/users/jedireza/followers","following_url":"https://api.github.com/users/jedireza/following{/other_user}","gists_url":"https://api.github.com/users/jedireza/gists{/gist_id}","starred_url":"https://api.github.com/users/jedireza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jedireza/subscriptions","organizations_url":"https://api.github.com/users/jedireza/orgs","repos_url":"https://api.github.com/users/jedireza/repos","events_url":"https://api.github.com/users/jedireza/events{/privacy}","received_events_url":"https://api.github.com/users/jedireza/received_events","type":"User","site_admin":false},"body":"Now we create the context and mock service before each test. I've made it more clear that we're executing the action again. Also confirmed with code coverage report.","created_at":"2015-02-05T18:33:05Z","updated_at":"2015-02-05T18:33:05Z","html_url":"https://github.com/yahoo/fluxible.io/pull/65#discussion_r24186246","pull_request_url":"https://api.github.com/repos/yahoo/fluxible.io/pulls/65","_links":{"self":{"href":"https://api.github.com/repos/yahoo/fluxible.io/pulls/comments/24186246"},"html":{"href":"https://github.com/yahoo/fluxible.io/pull/65#discussion_r24186246"},"pull_request":{"href":"https://api.github.com/repos/yahoo/fluxible.io/pulls/65"}}},"pull_request":{"url":"https://api.github.com/repos/yahoo/fluxible.io/pulls/65","id":28689429,"html_url":"https://github.com/yahoo/fluxible.io/pull/65","diff_url":"https://github.com/yahoo/fluxible.io/pull/65.diff","patch_url":"https://github.com/yahoo/fluxible.io/pull/65.patch","issue_url":"https://api.github.com/repos/yahoo/fluxible.io/issues/65","number":65,"state":"open","locked":false,"title":"Added unit tests for actions and stores","user":{"login":"jedireza","id":979929,"avatar_url":"https://avatars.githubusercontent.com/u/979929?v=3","gravatar_id":"","url":"https://api.github.com/users/jedireza","html_url":"https://github.com/jedireza","followers_url":"https://api.github.com/users/jedireza/followers","following_url":"https://api.github.com/users/jedireza/following{/other_user}","gists_url":"https://api.github.com/users/jedireza/gists{/gist_id}","starred_url":"https://api.github.com/users/jedireza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jedireza/subscriptions","organizations_url":"https://api.github.com/users/jedireza/orgs","repos_url":"https://api.github.com/users/jedireza/repos","events_url":"https://api.github.com/users/jedireza/events{/privacy}","received_events_url":"https://api.github.com/users/jedireza/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-02-05T00:35:28Z","updated_at":"2015-02-05T18:33:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"24a7584a0c024611da303d9997e77464a8683211","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/yahoo/fluxible.io/pulls/65/commits","review_comments_url":"https://api.github.com/repos/yahoo/fluxible.io/pulls/65/comments","review_comment_url":"https://api.github.com/repos/yahoo/fluxible.io/pulls/comments/{number}","comments_url":"https://api.github.com/repos/yahoo/fluxible.io/issues/65/comments","statuses_url":"https://api.github.com/repos/yahoo/fluxible.io/statuses/8ce033b8ab65c602878f1fe7f7c6669774bb445a","head":{"label":"jedireza:setup-tests","ref":"setup-tests","sha":"8ce033b8ab65c602878f1fe7f7c6669774bb445a","user":{"login":"jedireza","id":979929,"avatar_url":"https://avatars.githubusercontent.com/u/979929?v=3","gravatar_id":"","url":"https://api.github.com/users/jedireza","html_url":"https://github.com/jedireza","followers_url":"https://api.github.com/users/jedireza/followers","following_url":"https://api.github.com/users/jedireza/following{/other_user}","gists_url":"https://api.github.com/users/jedireza/gists{/gist_id}","starred_url":"https://api.github.com/users/jedireza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jedireza/subscriptions","organizations_url":"https://api.github.com/users/jedireza/orgs","repos_url":"https://api.github.com/users/jedireza/repos","events_url":"https://api.github.com/users/jedireza/events{/privacy}","received_events_url":"https://api.github.com/users/jedireza/received_events","type":"User","site_admin":false},"repo":{"id":29214393,"name":"fluxible.io","full_name":"jedireza/fluxible.io","owner":{"login":"jedireza","id":979929,"avatar_url":"https://avatars.githubusercontent.com/u/979929?v=3","gravatar_id":"","url":"https://api.github.com/users/jedireza","html_url":"https://github.com/jedireza","followers_url":"https://api.github.com/users/jedireza/followers","following_url":"https://api.github.com/users/jedireza/following{/other_user}","gists_url":"https://api.github.com/users/jedireza/gists{/gist_id}","starred_url":"https://api.github.com/users/jedireza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jedireza/subscriptions","organizations_url":"https://api.github.com/users/jedireza/orgs","repos_url":"https://api.github.com/users/jedireza/repos","events_url":"https://api.github.com/users/jedireza/events{/privacy}","received_events_url":"https://api.github.com/users/jedireza/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jedireza/fluxible.io","description":"fluxible.io website","fork":true,"url":"https://api.github.com/repos/jedireza/fluxible.io","forks_url":"https://api.github.com/repos/jedireza/fluxible.io/forks","keys_url":"https://api.github.com/repos/jedireza/fluxible.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jedireza/fluxible.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jedireza/fluxible.io/teams","hooks_url":"https://api.github.com/repos/jedireza/fluxible.io/hooks","issue_events_url":"https://api.github.com/repos/jedireza/fluxible.io/issues/events{/number}","events_url":"https://api.github.com/repos/jedireza/fluxible.io/events","assignees_url":"https://api.github.com/repos/jedireza/fluxible.io/assignees{/user}","branches_url":"https://api.github.com/repos/jedireza/fluxible.io/branches{/branch}","tags_url":"https://api.github.com/repos/jedireza/fluxible.io/tags","blobs_url":"https://api.github.com/repos/jedireza/fluxible.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jedireza/fluxible.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jedireza/fluxible.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/jedireza/fluxible.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jedireza/fluxible.io/statuses/{sha}","languages_url":"https://api.github.com/repos/jedireza/fluxible.io/languages","stargazers_url":"https://api.github.com/repos/jedireza/fluxible.io/stargazers","contributors_url":"https://api.github.com/repos/jedireza/fluxible.io/contributors","subscribers_url":"https://api.github.com/repos/jedireza/fluxible.io/subscribers","subscription_url":"https://api.github.com/repos/jedireza/fluxible.io/subscription","commits_url":"https://api.github.com/repos/jedireza/fluxible.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/jedireza/fluxible.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/jedireza/fluxible.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/jedireza/fluxible.io/issues/comments/{number}","contents_url":"https://api.github.com/repos/jedireza/fluxible.io/contents/{+path}","compare_url":"https://api.github.com/repos/jedireza/fluxible.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jedireza/fluxible.io/merges","archive_url":"https://api.github.com/repos/jedireza/fluxible.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jedireza/fluxible.io/downloads","issues_url":"https://api.github.com/repos/jedireza/fluxible.io/issues{/number}","pulls_url":"https://api.github.com/repos/jedireza/fluxible.io/pulls{/number}","milestones_url":"https://api.github.com/repos/jedireza/fluxible.io/milestones{/number}","notifications_url":"https://api.github.com/repos/jedireza/fluxible.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jedireza/fluxible.io/labels{/name}","releases_url":"https://api.github.com/repos/jedireza/fluxible.io/releases{/id}","created_at":"2015-01-13T22:22:44Z","updated_at":"2015-02-05T01:06:10Z","pushed_at":"2015-02-05T18:12:57Z","git_url":"git://github.com/jedireza/fluxible.io.git","ssh_url":"git@github.com:jedireza/fluxible.io.git","clone_url":"https://github.com/jedireza/fluxible.io.git","svn_url":"https://github.com/jedireza/fluxible.io","homepage":null,"size":1067,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"yahoo:master","ref":"master","sha":"6b67f033459a3c0d8174f9e51017ded335b7811a","user":{"login":"yahoo","id":16574,"avatar_url":"https://avatars.githubusercontent.com/u/16574?v=3","gravatar_id":"","url":"https://api.github.com/users/yahoo","html_url":"https://github.com/yahoo","followers_url":"https://api.github.com/users/yahoo/followers","following_url":"https://api.github.com/users/yahoo/following{/other_user}","gists_url":"https://api.github.com/users/yahoo/gists{/gist_id}","starred_url":"https://api.github.com/users/yahoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yahoo/subscriptions","organizations_url":"https://api.github.com/users/yahoo/orgs","repos_url":"https://api.github.com/users/yahoo/repos","events_url":"https://api.github.com/users/yahoo/events{/privacy}","received_events_url":"https://api.github.com/users/yahoo/received_events","type":"Organization","site_admin":false},"repo":{"id":29206631,"name":"fluxible.io","full_name":"yahoo/fluxible.io","owner":{"login":"yahoo","id":16574,"avatar_url":"https://avatars.githubusercontent.com/u/16574?v=3","gravatar_id":"","url":"https://api.github.com/users/yahoo","html_url":"https://github.com/yahoo","followers_url":"https://api.github.com/users/yahoo/followers","following_url":"https://api.github.com/users/yahoo/following{/other_user}","gists_url":"https://api.github.com/users/yahoo/gists{/gist_id}","starred_url":"https://api.github.com/users/yahoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yahoo/subscriptions","organizations_url":"https://api.github.com/users/yahoo/orgs","repos_url":"https://api.github.com/users/yahoo/repos","events_url":"https://api.github.com/users/yahoo/events{/privacy}","received_events_url":"https://api.github.com/users/yahoo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/yahoo/fluxible.io","description":"The doc site for Fluxible","fork":false,"url":"https://api.github.com/repos/yahoo/fluxible.io","forks_url":"https://api.github.com/repos/yahoo/fluxible.io/forks","keys_url":"https://api.github.com/repos/yahoo/fluxible.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yahoo/fluxible.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yahoo/fluxible.io/teams","hooks_url":"https://api.github.com/repos/yahoo/fluxible.io/hooks","issue_events_url":"https://api.github.com/repos/yahoo/fluxible.io/issues/events{/number}","events_url":"https://api.github.com/repos/yahoo/fluxible.io/events","assignees_url":"https://api.github.com/repos/yahoo/fluxible.io/assignees{/user}","branches_url":"https://api.github.com/repos/yahoo/fluxible.io/branches{/branch}","tags_url":"https://api.github.com/repos/yahoo/fluxible.io/tags","blobs_url":"https://api.github.com/repos/yahoo/fluxible.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yahoo/fluxible.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yahoo/fluxible.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/yahoo/fluxible.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yahoo/fluxible.io/statuses/{sha}","languages_url":"https://api.github.com/repos/yahoo/fluxible.io/languages","stargazers_url":"https://api.github.com/repos/yahoo/fluxible.io/stargazers","contributors_url":"https://api.github.com/repos/yahoo/fluxible.io/contributors","subscribers_url":"https://api.github.com/repos/yahoo/fluxible.io/subscribers","subscription_url":"https://api.github.com/repos/yahoo/fluxible.io/subscription","commits_url":"https://api.github.com/repos/yahoo/fluxible.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/yahoo/fluxible.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/yahoo/fluxible.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/yahoo/fluxible.io/issues/comments/{number}","contents_url":"https://api.github.com/repos/yahoo/fluxible.io/contents/{+path}","compare_url":"https://api.github.com/repos/yahoo/fluxible.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yahoo/fluxible.io/merges","archive_url":"https://api.github.com/repos/yahoo/fluxible.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yahoo/fluxible.io/downloads","issues_url":"https://api.github.com/repos/yahoo/fluxible.io/issues{/number}","pulls_url":"https://api.github.com/repos/yahoo/fluxible.io/pulls{/number}","milestones_url":"https://api.github.com/repos/yahoo/fluxible.io/milestones{/number}","notifications_url":"https://api.github.com/repos/yahoo/fluxible.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yahoo/fluxible.io/labels{/name}","releases_url":"https://api.github.com/repos/yahoo/fluxible.io/releases{/id}","created_at":"2015-01-13T19:22:03Z","updated_at":"2015-02-05T03:41:56Z","pushed_at":"2015-02-04T02:16:18Z","git_url":"git://github.com/yahoo/fluxible.io.git","ssh_url":"git@github.com:yahoo/fluxible.io.git","clone_url":"https://github.com/yahoo/fluxible.io.git","svn_url":"https://github.com/yahoo/fluxible.io","homepage":"http://fluxible.io","size":1610,"stargazers_count":14,"watchers_count":14,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":8,"forks":5,"open_issues":8,"watchers":14,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/yahoo/fluxible.io/pulls/65"},"html":{"href":"https://github.com/yahoo/fluxible.io/pull/65"},"issue":{"href":"https://api.github.com/repos/yahoo/fluxible.io/issues/65"},"comments":{"href":"https://api.github.com/repos/yahoo/fluxible.io/issues/65/comments"},"review_comments":{"href":"https://api.github.com/repos/yahoo/fluxible.io/pulls/65/comments"},"review_comment":{"href":"https://api.github.com/repos/yahoo/fluxible.io/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/yahoo/fluxible.io/pulls/65/commits"},"statuses":{"href":"https://api.github.com/repos/yahoo/fluxible.io/statuses/8ce033b8ab65c602878f1fe7f7c6669774bb445a"}}}}