{"action":"created","comment":{"url":"https://api.github.com/repos/Mafooch/Endeavor/pulls/comments/29112189","id":29112189,"diff_hunk":"@@ -0,0 +1,76 @@\n+require 'rails_helper'\n+\n+describe RecommendationsHelper do\n+  describe \"recommendation_valid?\" do\n+    context \"users and project exist\" do\n+      let!(:project_1) { FactoryGirl.create(:project) }\n+      let!(:project_2) { FactoryGirl.create(:project) }\n+\n+      it \"returns false when recommendation class and recommendation_for class\n+        are the same\" do\n+        expect(recommendation_valid?(project_1, project_2)).to eq false\n+        expect(recommendation_valid?(\n+          project_1.user, project_2.user)).to eq false\n+      end\n+\n+      it \"returns false when recommendation and recommendation_for\n+        are the same object.\" do\n+        expect(recommendation_valid?(project_1, project_1)).to eq false\n+      end\n+\n+      it \"returns false when the recommendation object is associated with\n+        the recommended_for object e.g. a user can't be recommended a project\n+        they own\" do\n+        expect(recommendation_valid?(project_1.user, project_1)).to eq false\n+        expect(recommendation_valid?(project_1, project_1.user)).to eq false\n+      end\n+\n+      it \"returns true when non the recommendation is neither associated with\n+        or of the same class as the recommended_for object\" do\n+        expect(recommendation_valid?(project_1, project_2.user)).to eq true\n+        expect(recommendation_valid?(project_2.user, project_1)).to eq true\n+      end\n+    end\n+  end\n+\n+  context \"projects and users exist with tagged skills and interests\" do\n+    let!(:project_1) do\n+      FactoryGirl.create(:project, skill_list: \"ruby, rails\",\n+                        interest_list: \"film, fitness\")\n+    end\n+    let!(:project_2) do\n+      FactoryGirl.create(:project, skill_list: \"writing, web design\",\n+                        interest_list: \"film, books\")\n+    end\n+    let!(:user_1) do\n+      FactoryGirl.create(:user, skill_list: \"css, rails\",\n+                        interest_list: \"film, books\")\n+    end\n+    let!(:user_2) do\n+      FactoryGirl.create(:user, skill_list: \"ruby, rails\")\n+    end\n+\n+    describe \"fetch_recommendations\" do\n+      it \"returns and orders the users that best match the skills and interests\n+        of the project\" do\n+        expect(fetch_recommendations(project_1, User)[0][0]).to eq user_1\n+        expect(fetch_recommendations(project_1, User)[1][0]).to eq user_2\n+      end\n+\n+      it \"returns and orders the projects that best match the skills and\n+        interests of the user\" do\n+        expect(fetch_recommendations(user_1, Project)[0][0]).to eq project_1\n+        expect(fetch_recommendations(user_1, Project)[1][0]).to eq project_2\n+      end\n+    end\n+\n+    describe \"matches\" do\n+      it \"returns two objects matching skills and interests\" do\n+        expect(matches(project_1, user_1)).to(\n+          eq [{ \"skill\"=>\"rails\" }, { \"interest\"=>\"film\" }])\n+        expect(matches(user_2, project_1)).to(\n+          eq [{ \"skill\"=>\"ruby\" }, { \"skill\"=>\"rails\" }])","path":"spec/helpers/recommendations_helper_spec.rb","position":72,"original_position":72,"commit_id":"5a5e71a59a554b37f12a89f08399a61f6a698cef","original_commit_id":"5a5e71a59a554b37f12a89f08399a61f6a698cef","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Surrounding space missing for operator '=>'.","created_at":"2015-04-26T18:01:30Z","updated_at":"2015-04-26T18:01:30Z","html_url":"https://github.com/Mafooch/Endeavor/pull/9#discussion_r29112189","pull_request_url":"https://api.github.com/repos/Mafooch/Endeavor/pulls/9","_links":{"self":{"href":"https://api.github.com/repos/Mafooch/Endeavor/pulls/comments/29112189"},"html":{"href":"https://github.com/Mafooch/Endeavor/pull/9#discussion_r29112189"},"pull_request":{"href":"https://api.github.com/repos/Mafooch/Endeavor/pulls/9"}}},"pull_request":{"url":"https://api.github.com/repos/Mafooch/Endeavor/pulls/9","id":34126877,"html_url":"https://github.com/Mafooch/Endeavor/pull/9","diff_url":"https://github.com/Mafooch/Endeavor/pull/9.diff","patch_url":"https://github.com/Mafooch/Endeavor/pull/9.patch","issue_url":"https://api.github.com/repos/Mafooch/Endeavor/issues/9","number":9,"state":"open","locked":false,"title":"WIP Refactor","user":{"login":"Mafooch","id":10200567,"avatar_url":"https://avatars.githubusercontent.com/u/10200567?v=3","gravatar_id":"","url":"https://api.github.com/users/Mafooch","html_url":"https://github.com/Mafooch","followers_url":"https://api.github.com/users/Mafooch/followers","following_url":"https://api.github.com/users/Mafooch/following{/other_user}","gists_url":"https://api.github.com/users/Mafooch/gists{/gist_id}","starred_url":"https://api.github.com/users/Mafooch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mafooch/subscriptions","organizations_url":"https://api.github.com/users/Mafooch/orgs","repos_url":"https://api.github.com/users/Mafooch/repos","events_url":"https://api.github.com/users/Mafooch/events{/privacy}","received_events_url":"https://api.github.com/users/Mafooch/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-04-26T17:54:00Z","updated_at":"2015-04-26T18:01:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"456629322a1974b22f876fa66044fc392dd4d37a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Mafooch/Endeavor/pulls/9/commits","review_comments_url":"https://api.github.com/repos/Mafooch/Endeavor/pulls/9/comments","review_comment_url":"https://api.github.com/repos/Mafooch/Endeavor/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Mafooch/Endeavor/issues/9/comments","statuses_url":"https://api.github.com/repos/Mafooch/Endeavor/statuses/5a5e71a59a554b37f12a89f08399a61f6a698cef","head":{"label":"Mafooch:refactor","ref":"refactor","sha":"5a5e71a59a554b37f12a89f08399a61f6a698cef","user":{"login":"Mafooch","id":10200567,"avatar_url":"https://avatars.githubusercontent.com/u/10200567?v=3","gravatar_id":"","url":"https://api.github.com/users/Mafooch","html_url":"https://github.com/Mafooch","followers_url":"https://api.github.com/users/Mafooch/followers","following_url":"https://api.github.com/users/Mafooch/following{/other_user}","gists_url":"https://api.github.com/users/Mafooch/gists{/gist_id}","starred_url":"https://api.github.com/users/Mafooch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mafooch/subscriptions","organizations_url":"https://api.github.com/users/Mafooch/orgs","repos_url":"https://api.github.com/users/Mafooch/repos","events_url":"https://api.github.com/users/Mafooch/events{/privacy}","received_events_url":"https://api.github.com/users/Mafooch/received_events","type":"User","site_admin":false},"repo":{"id":34017183,"name":"Endeavor","full_name":"Mafooch/Endeavor","owner":{"login":"Mafooch","id":10200567,"avatar_url":"https://avatars.githubusercontent.com/u/10200567?v=3","gravatar_id":"","url":"https://api.github.com/users/Mafooch","html_url":"https://github.com/Mafooch","followers_url":"https://api.github.com/users/Mafooch/followers","following_url":"https://api.github.com/users/Mafooch/following{/other_user}","gists_url":"https://api.github.com/users/Mafooch/gists{/gist_id}","starred_url":"https://api.github.com/users/Mafooch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mafooch/subscriptions","organizations_url":"https://api.github.com/users/Mafooch/orgs","repos_url":"https://api.github.com/users/Mafooch/repos","events_url":"https://api.github.com/users/Mafooch/events{/privacy}","received_events_url":"https://api.github.com/users/Mafooch/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Mafooch/Endeavor","description":"Breakable Toy: Allows like-minded individuals with similar interests and complementary skills to work on projects they care about.","fork":false,"url":"https://api.github.com/repos/Mafooch/Endeavor","forks_url":"https://api.github.com/repos/Mafooch/Endeavor/forks","keys_url":"https://api.github.com/repos/Mafooch/Endeavor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Mafooch/Endeavor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Mafooch/Endeavor/teams","hooks_url":"https://api.github.com/repos/Mafooch/Endeavor/hooks","issue_events_url":"https://api.github.com/repos/Mafooch/Endeavor/issues/events{/number}","events_url":"https://api.github.com/repos/Mafooch/Endeavor/events","assignees_url":"https://api.github.com/repos/Mafooch/Endeavor/assignees{/user}","branches_url":"https://api.github.com/repos/Mafooch/Endeavor/branches{/branch}","tags_url":"https://api.github.com/repos/Mafooch/Endeavor/tags","blobs_url":"https://api.github.com/repos/Mafooch/Endeavor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Mafooch/Endeavor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Mafooch/Endeavor/git/refs{/sha}","trees_url":"https://api.github.com/repos/Mafooch/Endeavor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Mafooch/Endeavor/statuses/{sha}","languages_url":"https://api.github.com/repos/Mafooch/Endeavor/languages","stargazers_url":"https://api.github.com/repos/Mafooch/Endeavor/stargazers","contributors_url":"https://api.github.com/repos/Mafooch/Endeavor/contributors","subscribers_url":"https://api.github.com/repos/Mafooch/Endeavor/subscribers","subscription_url":"https://api.github.com/repos/Mafooch/Endeavor/subscription","commits_url":"https://api.github.com/repos/Mafooch/Endeavor/commits{/sha}","git_commits_url":"https://api.github.com/repos/Mafooch/Endeavor/git/commits{/sha}","comments_url":"https://api.github.com/repos/Mafooch/Endeavor/comments{/number}","issue_comment_url":"https://api.github.com/repos/Mafooch/Endeavor/issues/comments{/number}","contents_url":"https://api.github.com/repos/Mafooch/Endeavor/contents/{+path}","compare_url":"https://api.github.com/repos/Mafooch/Endeavor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Mafooch/Endeavor/merges","archive_url":"https://api.github.com/repos/Mafooch/Endeavor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Mafooch/Endeavor/downloads","issues_url":"https://api.github.com/repos/Mafooch/Endeavor/issues{/number}","pulls_url":"https://api.github.com/repos/Mafooch/Endeavor/pulls{/number}","milestones_url":"https://api.github.com/repos/Mafooch/Endeavor/milestones{/number}","notifications_url":"https://api.github.com/repos/Mafooch/Endeavor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Mafooch/Endeavor/labels{/name}","releases_url":"https://api.github.com/repos/Mafooch/Endeavor/releases{/id}","created_at":"2015-04-15T20:34:08Z","updated_at":"2015-04-23T19:40:21Z","pushed_at":"2015-04-26T18:01:22Z","git_url":"git://github.com/Mafooch/Endeavor.git","ssh_url":"git@github.com:Mafooch/Endeavor.git","clone_url":"https://github.com/Mafooch/Endeavor.git","svn_url":"https://github.com/Mafooch/Endeavor","homepage":"","size":3672,"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":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"Mafooch:master","ref":"master","sha":"5b86ae31ddeb7d92482db626b19811fe95e22f7d","user":{"login":"Mafooch","id":10200567,"avatar_url":"https://avatars.githubusercontent.com/u/10200567?v=3","gravatar_id":"","url":"https://api.github.com/users/Mafooch","html_url":"https://github.com/Mafooch","followers_url":"https://api.github.com/users/Mafooch/followers","following_url":"https://api.github.com/users/Mafooch/following{/other_user}","gists_url":"https://api.github.com/users/Mafooch/gists{/gist_id}","starred_url":"https://api.github.com/users/Mafooch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mafooch/subscriptions","organizations_url":"https://api.github.com/users/Mafooch/orgs","repos_url":"https://api.github.com/users/Mafooch/repos","events_url":"https://api.github.com/users/Mafooch/events{/privacy}","received_events_url":"https://api.github.com/users/Mafooch/received_events","type":"User","site_admin":false},"repo":{"id":34017183,"name":"Endeavor","full_name":"Mafooch/Endeavor","owner":{"login":"Mafooch","id":10200567,"avatar_url":"https://avatars.githubusercontent.com/u/10200567?v=3","gravatar_id":"","url":"https://api.github.com/users/Mafooch","html_url":"https://github.com/Mafooch","followers_url":"https://api.github.com/users/Mafooch/followers","following_url":"https://api.github.com/users/Mafooch/following{/other_user}","gists_url":"https://api.github.com/users/Mafooch/gists{/gist_id}","starred_url":"https://api.github.com/users/Mafooch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mafooch/subscriptions","organizations_url":"https://api.github.com/users/Mafooch/orgs","repos_url":"https://api.github.com/users/Mafooch/repos","events_url":"https://api.github.com/users/Mafooch/events{/privacy}","received_events_url":"https://api.github.com/users/Mafooch/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Mafooch/Endeavor","description":"Breakable Toy: Allows like-minded individuals with similar interests and complementary skills to work on projects they care about.","fork":false,"url":"https://api.github.com/repos/Mafooch/Endeavor","forks_url":"https://api.github.com/repos/Mafooch/Endeavor/forks","keys_url":"https://api.github.com/repos/Mafooch/Endeavor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Mafooch/Endeavor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Mafooch/Endeavor/teams","hooks_url":"https://api.github.com/repos/Mafooch/Endeavor/hooks","issue_events_url":"https://api.github.com/repos/Mafooch/Endeavor/issues/events{/number}","events_url":"https://api.github.com/repos/Mafooch/Endeavor/events","assignees_url":"https://api.github.com/repos/Mafooch/Endeavor/assignees{/user}","branches_url":"https://api.github.com/repos/Mafooch/Endeavor/branches{/branch}","tags_url":"https://api.github.com/repos/Mafooch/Endeavor/tags","blobs_url":"https://api.github.com/repos/Mafooch/Endeavor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Mafooch/Endeavor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Mafooch/Endeavor/git/refs{/sha}","trees_url":"https://api.github.com/repos/Mafooch/Endeavor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Mafooch/Endeavor/statuses/{sha}","languages_url":"https://api.github.com/repos/Mafooch/Endeavor/languages","stargazers_url":"https://api.github.com/repos/Mafooch/Endeavor/stargazers","contributors_url":"https://api.github.com/repos/Mafooch/Endeavor/contributors","subscribers_url":"https://api.github.com/repos/Mafooch/Endeavor/subscribers","subscription_url":"https://api.github.com/repos/Mafooch/Endeavor/subscription","commits_url":"https://api.github.com/repos/Mafooch/Endeavor/commits{/sha}","git_commits_url":"https://api.github.com/repos/Mafooch/Endeavor/git/commits{/sha}","comments_url":"https://api.github.com/repos/Mafooch/Endeavor/comments{/number}","issue_comment_url":"https://api.github.com/repos/Mafooch/Endeavor/issues/comments{/number}","contents_url":"https://api.github.com/repos/Mafooch/Endeavor/contents/{+path}","compare_url":"https://api.github.com/repos/Mafooch/Endeavor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Mafooch/Endeavor/merges","archive_url":"https://api.github.com/repos/Mafooch/Endeavor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Mafooch/Endeavor/downloads","issues_url":"https://api.github.com/repos/Mafooch/Endeavor/issues{/number}","pulls_url":"https://api.github.com/repos/Mafooch/Endeavor/pulls{/number}","milestones_url":"https://api.github.com/repos/Mafooch/Endeavor/milestones{/number}","notifications_url":"https://api.github.com/repos/Mafooch/Endeavor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Mafooch/Endeavor/labels{/name}","releases_url":"https://api.github.com/repos/Mafooch/Endeavor/releases{/id}","created_at":"2015-04-15T20:34:08Z","updated_at":"2015-04-23T19:40:21Z","pushed_at":"2015-04-26T18:01:22Z","git_url":"git://github.com/Mafooch/Endeavor.git","ssh_url":"git@github.com:Mafooch/Endeavor.git","clone_url":"https://github.com/Mafooch/Endeavor.git","svn_url":"https://github.com/Mafooch/Endeavor","homepage":"","size":3672,"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":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Mafooch/Endeavor/pulls/9"},"html":{"href":"https://github.com/Mafooch/Endeavor/pull/9"},"issue":{"href":"https://api.github.com/repos/Mafooch/Endeavor/issues/9"},"comments":{"href":"https://api.github.com/repos/Mafooch/Endeavor/issues/9/comments"},"review_comments":{"href":"https://api.github.com/repos/Mafooch/Endeavor/pulls/9/comments"},"review_comment":{"href":"https://api.github.com/repos/Mafooch/Endeavor/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Mafooch/Endeavor/pulls/9/commits"},"statuses":{"href":"https://api.github.com/repos/Mafooch/Endeavor/statuses/5a5e71a59a554b37f12a89f08399a61f6a698cef"}}}}