{"action":"created","comment":{"url":"https://api.github.com/repos/triAGENS/guacamole/pulls/comments/25356389","id":25356389,"diff_hunk":"@@ -102,12 +91,63 @@ def retrieve_or_store(*args, &block)\n         subject.document_to_model document\n       end\n \n-      it 'should assign the relation proxy for the appropriate attribute' do\n-        pending 'Finish the specs'\n-        expect(model_instance).to receive(:my_relation=).with(relation_proxy)\n+      it 'should set a proxy for each edge_attribute' do\n+        expect(model_instance).to receive(:send).with(setter_for_relation, relation_proxy)\n \n         subject.document_to_model document\n       end\n+\n+      context 'setting the proxy' do\n+        let(:related_edge_class) { instance_double('Guacamole::Edge') }\n+        let(:relation_proxy_class) { Guacamole::Proxies::Relation }\n+        let(:relation_proxy) { instance_double('Guacamole::Proxies::Relation') }\n+\n+        before do\n+          allow(attribute_with_edge_relation).to receive(:edge_class).and_return(related_edge_class)\n+          allow(attribute_with_edge_relation).to receive(:inverse?).and_return(false)\n+          allow(relation_proxy_class).to receive(:new).and_return(relation_proxy)\n+          allow(subject).to receive(:build_proxy).and_call_original\n+          allow(subject).to receive(:edge_attribute_a_collection?).and_return(false)\n+        end\n+\n+        it 'should build the proxy with the model, the attribute class and options' do\n+          expect(relation_proxy_class).to receive(:new).\n+                                          with(model_instance, related_edge_class, hash_including(just_one: true, inverse: false)).\n+                                          and_return(relation_proxy)\n+\n+          expect(subject.build_proxy(model_instance, attribute_with_edge_relation)).to eq relation_proxy\n+        end\n+        \n+        it 'should set the option :inverse based on the edge_attribute' do\n+          expect(subject).to receive(:edge_attribute_a_collection?).with(model_instance, attribute_with_edge_relation)\n+\n+          subject.build_proxy(model_instance, attribute_with_edge_relation)\n+        end\n+\n+        it 'should set the option :just_one based on the edge_attribute type' do\n+          inverse_value = double('InverseValue')\n+          allow(attribute_with_edge_relation).to receive(:inverse?).and_return(inverse_value)\n+          expect(relation_proxy_class).to receive(:new).\n+                                          with(anything, anything, hash_including(inverse: inverse_value))\n+\n+          subject.build_proxy(model_instance, attribute_with_edge_relation)\n+        end\n+\n+        it 'should check the edge_attribute type for a Virtus collection type' do\n+          model_class, attribute_set, attribute_type, virtus_collection_type = [double]*4\n+          stub_const('Virtus::Attribute::Collection::Type', virtus_collection_type)\n+\n+          allow(subject).to receive(:edge_attribute_a_collection?).and_call_original\n+\n+          allow(model_instance).to receive(:class).and_return(model_class)\n+          allow(model_class).to receive(:attribute_set).and_return(attribute_set)\n+          allow(attribute_set).to receive(:[]).with(attribute_with_edge_relation.name).and_return(attribute_type)\n+          allow(attribute_type).to receive(:type).and_return(attribute_type)\n+          expect(attribute_type).to receive(:is_a?).with(virtus_collection_type).and_return(false)\n+          ","path":"spec/unit/document_model_mapper_spec.rb","position":93,"original_position":93,"commit_id":"7410be6f94829e4c8637101d9f87228c358fe768","original_commit_id":"7410be6f94829e4c8637101d9f87228c358fe768","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":"Trailing whitespace detected.","created_at":"2015-02-25T16:52:47Z","updated_at":"2015-02-25T16:52:47Z","html_url":"https://github.com/triAGENS/guacamole/pull/107#discussion_r25356389","pull_request_url":"https://api.github.com/repos/triAGENS/guacamole/pulls/107","_links":{"self":{"href":"https://api.github.com/repos/triAGENS/guacamole/pulls/comments/25356389"},"html":{"href":"https://github.com/triAGENS/guacamole/pull/107#discussion_r25356389"},"pull_request":{"href":"https://api.github.com/repos/triAGENS/guacamole/pulls/107"}}},"pull_request":{"url":"https://api.github.com/repos/triAGENS/guacamole/pulls/107","id":29709467,"html_url":"https://github.com/triAGENS/guacamole/pull/107","diff_url":"https://github.com/triAGENS/guacamole/pull/107.diff","patch_url":"https://github.com/triAGENS/guacamole/pull/107.patch","issue_url":"https://api.github.com/repos/triAGENS/guacamole/issues/107","number":107,"state":"open","locked":false,"title":"Added specs and solved pending specs","user":{"login":"railsbros-dirk","id":1948,"avatar_url":"https://avatars.githubusercontent.com/u/1948?v=3","gravatar_id":"","url":"https://api.github.com/users/railsbros-dirk","html_url":"https://github.com/railsbros-dirk","followers_url":"https://api.github.com/users/railsbros-dirk/followers","following_url":"https://api.github.com/users/railsbros-dirk/following{/other_user}","gists_url":"https://api.github.com/users/railsbros-dirk/gists{/gist_id}","starred_url":"https://api.github.com/users/railsbros-dirk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/railsbros-dirk/subscriptions","organizations_url":"https://api.github.com/users/railsbros-dirk/orgs","repos_url":"https://api.github.com/users/railsbros-dirk/repos","events_url":"https://api.github.com/users/railsbros-dirk/events{/privacy}","received_events_url":"https://api.github.com/users/railsbros-dirk/received_events","type":"User","site_admin":false},"body":"This is one of the todos in #100 ","created_at":"2015-02-20T16:30:46Z","updated_at":"2015-02-25T16:52:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"abb49f6a367c2e50c510e5e84f42ffeab628036b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/triAGENS/guacamole/pulls/107/commits","review_comments_url":"https://api.github.com/repos/triAGENS/guacamole/pulls/107/comments","review_comment_url":"https://api.github.com/repos/triAGENS/guacamole/pulls/comments{/number}","comments_url":"https://api.github.com/repos/triAGENS/guacamole/issues/107/comments","statuses_url":"https://api.github.com/repos/triAGENS/guacamole/statuses/7410be6f94829e4c8637101d9f87228c358fe768","head":{"label":"triAGENS:add-more-specs","ref":"add-more-specs","sha":"7410be6f94829e4c8637101d9f87228c358fe768","user":{"login":"triAGENS","id":391956,"avatar_url":"https://avatars.githubusercontent.com/u/391956?v=3","gravatar_id":"","url":"https://api.github.com/users/triAGENS","html_url":"https://github.com/triAGENS","followers_url":"https://api.github.com/users/triAGENS/followers","following_url":"https://api.github.com/users/triAGENS/following{/other_user}","gists_url":"https://api.github.com/users/triAGENS/gists{/gist_id}","starred_url":"https://api.github.com/users/triAGENS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/triAGENS/subscriptions","organizations_url":"https://api.github.com/users/triAGENS/orgs","repos_url":"https://api.github.com/users/triAGENS/repos","events_url":"https://api.github.com/users/triAGENS/events{/privacy}","received_events_url":"https://api.github.com/users/triAGENS/received_events","type":"Organization","site_admin":false},"repo":{"id":13539956,"name":"guacamole","full_name":"triAGENS/guacamole","owner":{"login":"triAGENS","id":391956,"avatar_url":"https://avatars.githubusercontent.com/u/391956?v=3","gravatar_id":"","url":"https://api.github.com/users/triAGENS","html_url":"https://github.com/triAGENS","followers_url":"https://api.github.com/users/triAGENS/followers","following_url":"https://api.github.com/users/triAGENS/following{/other_user}","gists_url":"https://api.github.com/users/triAGENS/gists{/gist_id}","starred_url":"https://api.github.com/users/triAGENS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/triAGENS/subscriptions","organizations_url":"https://api.github.com/users/triAGENS/orgs","repos_url":"https://api.github.com/users/triAGENS/repos","events_url":"https://api.github.com/users/triAGENS/events{/privacy}","received_events_url":"https://api.github.com/users/triAGENS/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/triAGENS/guacamole","description":"An ODM for ArangoDB in Ruby","fork":false,"url":"https://api.github.com/repos/triAGENS/guacamole","forks_url":"https://api.github.com/repos/triAGENS/guacamole/forks","keys_url":"https://api.github.com/repos/triAGENS/guacamole/keys{/key_id}","collaborators_url":"https://api.github.com/repos/triAGENS/guacamole/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/triAGENS/guacamole/teams","hooks_url":"https://api.github.com/repos/triAGENS/guacamole/hooks","issue_events_url":"https://api.github.com/repos/triAGENS/guacamole/issues/events{/number}","events_url":"https://api.github.com/repos/triAGENS/guacamole/events","assignees_url":"https://api.github.com/repos/triAGENS/guacamole/assignees{/user}","branches_url":"https://api.github.com/repos/triAGENS/guacamole/branches{/branch}","tags_url":"https://api.github.com/repos/triAGENS/guacamole/tags","blobs_url":"https://api.github.com/repos/triAGENS/guacamole/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/triAGENS/guacamole/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/triAGENS/guacamole/git/refs{/sha}","trees_url":"https://api.github.com/repos/triAGENS/guacamole/git/trees{/sha}","statuses_url":"https://api.github.com/repos/triAGENS/guacamole/statuses/{sha}","languages_url":"https://api.github.com/repos/triAGENS/guacamole/languages","stargazers_url":"https://api.github.com/repos/triAGENS/guacamole/stargazers","contributors_url":"https://api.github.com/repos/triAGENS/guacamole/contributors","subscribers_url":"https://api.github.com/repos/triAGENS/guacamole/subscribers","subscription_url":"https://api.github.com/repos/triAGENS/guacamole/subscription","commits_url":"https://api.github.com/repos/triAGENS/guacamole/commits{/sha}","git_commits_url":"https://api.github.com/repos/triAGENS/guacamole/git/commits{/sha}","comments_url":"https://api.github.com/repos/triAGENS/guacamole/comments{/number}","issue_comment_url":"https://api.github.com/repos/triAGENS/guacamole/issues/comments{/number}","contents_url":"https://api.github.com/repos/triAGENS/guacamole/contents/{+path}","compare_url":"https://api.github.com/repos/triAGENS/guacamole/compare/{base}...{head}","merges_url":"https://api.github.com/repos/triAGENS/guacamole/merges","archive_url":"https://api.github.com/repos/triAGENS/guacamole/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/triAGENS/guacamole/downloads","issues_url":"https://api.github.com/repos/triAGENS/guacamole/issues{/number}","pulls_url":"https://api.github.com/repos/triAGENS/guacamole/pulls{/number}","milestones_url":"https://api.github.com/repos/triAGENS/guacamole/milestones{/number}","notifications_url":"https://api.github.com/repos/triAGENS/guacamole/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/triAGENS/guacamole/labels{/name}","releases_url":"https://api.github.com/repos/triAGENS/guacamole/releases{/id}","created_at":"2013-10-13T13:48:10Z","updated_at":"2015-02-18T16:01:24Z","pushed_at":"2015-02-25T16:52:40Z","git_url":"git://github.com/triAGENS/guacamole.git","ssh_url":"git@github.com:triAGENS/guacamole.git","clone_url":"https://github.com/triAGENS/guacamole.git","svn_url":"https://github.com/triAGENS/guacamole","homepage":"guacamolegem.org","size":1642,"stargazers_count":47,"watchers_count":47,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":16,"mirror_url":null,"open_issues_count":22,"forks":16,"open_issues":22,"watchers":47,"default_branch":"master"}},"base":{"label":"triAGENS:master","ref":"master","sha":"ac8f6bb4d736e483771c2041dcaf9d1916f6b939","user":{"login":"triAGENS","id":391956,"avatar_url":"https://avatars.githubusercontent.com/u/391956?v=3","gravatar_id":"","url":"https://api.github.com/users/triAGENS","html_url":"https://github.com/triAGENS","followers_url":"https://api.github.com/users/triAGENS/followers","following_url":"https://api.github.com/users/triAGENS/following{/other_user}","gists_url":"https://api.github.com/users/triAGENS/gists{/gist_id}","starred_url":"https://api.github.com/users/triAGENS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/triAGENS/subscriptions","organizations_url":"https://api.github.com/users/triAGENS/orgs","repos_url":"https://api.github.com/users/triAGENS/repos","events_url":"https://api.github.com/users/triAGENS/events{/privacy}","received_events_url":"https://api.github.com/users/triAGENS/received_events","type":"Organization","site_admin":false},"repo":{"id":13539956,"name":"guacamole","full_name":"triAGENS/guacamole","owner":{"login":"triAGENS","id":391956,"avatar_url":"https://avatars.githubusercontent.com/u/391956?v=3","gravatar_id":"","url":"https://api.github.com/users/triAGENS","html_url":"https://github.com/triAGENS","followers_url":"https://api.github.com/users/triAGENS/followers","following_url":"https://api.github.com/users/triAGENS/following{/other_user}","gists_url":"https://api.github.com/users/triAGENS/gists{/gist_id}","starred_url":"https://api.github.com/users/triAGENS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/triAGENS/subscriptions","organizations_url":"https://api.github.com/users/triAGENS/orgs","repos_url":"https://api.github.com/users/triAGENS/repos","events_url":"https://api.github.com/users/triAGENS/events{/privacy}","received_events_url":"https://api.github.com/users/triAGENS/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/triAGENS/guacamole","description":"An ODM for ArangoDB in Ruby","fork":false,"url":"https://api.github.com/repos/triAGENS/guacamole","forks_url":"https://api.github.com/repos/triAGENS/guacamole/forks","keys_url":"https://api.github.com/repos/triAGENS/guacamole/keys{/key_id}","collaborators_url":"https://api.github.com/repos/triAGENS/guacamole/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/triAGENS/guacamole/teams","hooks_url":"https://api.github.com/repos/triAGENS/guacamole/hooks","issue_events_url":"https://api.github.com/repos/triAGENS/guacamole/issues/events{/number}","events_url":"https://api.github.com/repos/triAGENS/guacamole/events","assignees_url":"https://api.github.com/repos/triAGENS/guacamole/assignees{/user}","branches_url":"https://api.github.com/repos/triAGENS/guacamole/branches{/branch}","tags_url":"https://api.github.com/repos/triAGENS/guacamole/tags","blobs_url":"https://api.github.com/repos/triAGENS/guacamole/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/triAGENS/guacamole/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/triAGENS/guacamole/git/refs{/sha}","trees_url":"https://api.github.com/repos/triAGENS/guacamole/git/trees{/sha}","statuses_url":"https://api.github.com/repos/triAGENS/guacamole/statuses/{sha}","languages_url":"https://api.github.com/repos/triAGENS/guacamole/languages","stargazers_url":"https://api.github.com/repos/triAGENS/guacamole/stargazers","contributors_url":"https://api.github.com/repos/triAGENS/guacamole/contributors","subscribers_url":"https://api.github.com/repos/triAGENS/guacamole/subscribers","subscription_url":"https://api.github.com/repos/triAGENS/guacamole/subscription","commits_url":"https://api.github.com/repos/triAGENS/guacamole/commits{/sha}","git_commits_url":"https://api.github.com/repos/triAGENS/guacamole/git/commits{/sha}","comments_url":"https://api.github.com/repos/triAGENS/guacamole/comments{/number}","issue_comment_url":"https://api.github.com/repos/triAGENS/guacamole/issues/comments{/number}","contents_url":"https://api.github.com/repos/triAGENS/guacamole/contents/{+path}","compare_url":"https://api.github.com/repos/triAGENS/guacamole/compare/{base}...{head}","merges_url":"https://api.github.com/repos/triAGENS/guacamole/merges","archive_url":"https://api.github.com/repos/triAGENS/guacamole/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/triAGENS/guacamole/downloads","issues_url":"https://api.github.com/repos/triAGENS/guacamole/issues{/number}","pulls_url":"https://api.github.com/repos/triAGENS/guacamole/pulls{/number}","milestones_url":"https://api.github.com/repos/triAGENS/guacamole/milestones{/number}","notifications_url":"https://api.github.com/repos/triAGENS/guacamole/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/triAGENS/guacamole/labels{/name}","releases_url":"https://api.github.com/repos/triAGENS/guacamole/releases{/id}","created_at":"2013-10-13T13:48:10Z","updated_at":"2015-02-18T16:01:24Z","pushed_at":"2015-02-25T16:52:40Z","git_url":"git://github.com/triAGENS/guacamole.git","ssh_url":"git@github.com:triAGENS/guacamole.git","clone_url":"https://github.com/triAGENS/guacamole.git","svn_url":"https://github.com/triAGENS/guacamole","homepage":"guacamolegem.org","size":1642,"stargazers_count":47,"watchers_count":47,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":16,"mirror_url":null,"open_issues_count":22,"forks":16,"open_issues":22,"watchers":47,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/triAGENS/guacamole/pulls/107"},"html":{"href":"https://github.com/triAGENS/guacamole/pull/107"},"issue":{"href":"https://api.github.com/repos/triAGENS/guacamole/issues/107"},"comments":{"href":"https://api.github.com/repos/triAGENS/guacamole/issues/107/comments"},"review_comments":{"href":"https://api.github.com/repos/triAGENS/guacamole/pulls/107/comments"},"review_comment":{"href":"https://api.github.com/repos/triAGENS/guacamole/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/triAGENS/guacamole/pulls/107/commits"},"statuses":{"href":"https://api.github.com/repos/triAGENS/guacamole/statuses/7410be6f94829e4c8637101d9f87228c358fe768"}}}}