{"action":"created","comment":{"url":"https://api.github.com/repos/maestrano/connector-shopify/pulls/comments/54999952","id":54999952,"diff_hunk":"@@ -13,83 +13,53 @@\n   describe 'instance methods' do\n     subject { Maestrano::Connector::Rails::Entity.new }\n     let(:organization) { create(:organization) }\n-    let(:client) { Restforce.new }\n+    let(:client) { ShopifyClient.new(1,2) }\n     let(:external_name) { 'external_name' }\n     before {\n       allow(subject).to receive(:external_entity_name).and_return(external_name)\n       allow(subject).to receive(:external_attributes).and_return(%w(FirstName LastName))\n     }\n-\n     describe 'get_external_entities' do\n-      context 'with full sync option' do\n-        it 'uses a full query' do\n-          expect(client).to receive(:query).with(/select Id, LastModifiedDate, FirstName, LastName from #{external_name}/i)\n-          subject.get_external_entities(client, nil, organization, {full_sync: true})\n-        end\n-      end\n-\n-      context 'without option' do\n-        context 'without last sync' do\n-          it 'uses a full query' do\n-            expect(client).to receive(:query).with(/select Id, LastModifiedDate, FirstName, LastName from #{external_name}/i)\n-            subject.get_external_entities(client, nil, organization)\n-          end\n-        end\n-\n-        context 'with a last sync' do\n-          let(:last_sync) { create(:synchronization, updated_at: 1.hour.ago) }\n-\n-          it 'uses get updated' do\n-            Timecop.freeze(Date.today) do\n-              allow(client).to receive(:get_updated).and_return({'ids' => []})\n-              expect(client).to receive(:get_updated).with(external_name, last_sync.updated_at, Time.now)\n-              subject.get_external_entities(client, last_sync, organization)\n-            end\n-          end\n \n-          it 'calls find on received ids' do\n-            allow(client).to receive(:get_updated).and_return({'ids' => [3, 5, 6]})\n-            expect(client).to receive(:find).with(external_name, 3)\n-            expect(client).to receive(:find).with(external_name, 5)\n-            expect(client).to receive(:find).with(external_name, 6)\n-            subject.get_external_entities(client, last_sync, organization)\n-          end\n+      it 'calls find' do\n+        expect(client).to receive(:find).with(external_name)\n+        subject.get_external_entities(client, nil, organization)\n+      end\n \n-          it 'returns the entities' do\n-            allow(client).to receive(:get_updated).and_return({'ids' => [3, 5, 6]})\n-            allow(client).to receive(:find).and_return({'FirstName' => 'John'})\n-            expect(subject.get_external_entities(client, last_sync, organization)).to eql([{'FirstName' => 'John'}, {'FirstName' => 'John'}, {'FirstName' => 'John'}])\n-          end\n-        end\n+      it 'returns the entities' do\n+        allow(client).to receive(:find).and_return([{'FirstName' => 'John'}])\n+        expect(subject.get_external_entities(client, nil, organization)).to eql([{'FirstName' => 'John'}])\n       end\n     end\n \n-    describe 'create_entity_to_external' do\n-      it 'calls create!' do\n-        expect(client).to receive(:create!).with(external_name, {})\n-        subject.create_entity_to_external(client, {}, external_name, organization)\n+\n+    describe 'create_external_entity' do","path":"spec/models/entity_spec.rb","position":68,"original_position":68,"commit_id":"aacc2a0ffe20147c8af3b3b6e79688b431b97bbf","original_commit_id":"aacc2a0ffe20147c8af3b3b6e79688b431b97bbf","user":{"login":"Berardpi","id":9036578,"avatar_url":"https://avatars.githubusercontent.com/u/9036578?v=3","gravatar_id":"","url":"https://api.github.com/users/Berardpi","html_url":"https://github.com/Berardpi","followers_url":"https://api.github.com/users/Berardpi/followers","following_url":"https://api.github.com/users/Berardpi/following{/other_user}","gists_url":"https://api.github.com/users/Berardpi/gists{/gist_id}","starred_url":"https://api.github.com/users/Berardpi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Berardpi/subscriptions","organizations_url":"https://api.github.com/users/Berardpi/orgs","repos_url":"https://api.github.com/users/Berardpi/repos","events_url":"https://api.github.com/users/Berardpi/events{/privacy}","received_events_url":"https://api.github.com/users/Berardpi/received_events","type":"User","site_admin":false},"body":"Would be nice to test if it returns the id","created_at":"2016-03-04T07:55:29Z","updated_at":"2016-03-04T07:55:29Z","html_url":"https://github.com/maestrano/connector-shopify/pull/1#discussion_r54999952","pull_request_url":"https://api.github.com/repos/maestrano/connector-shopify/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/maestrano/connector-shopify/pulls/comments/54999952"},"html":{"href":"https://github.com/maestrano/connector-shopify/pull/1#discussion_r54999952"},"pull_request":{"href":"https://api.github.com/repos/maestrano/connector-shopify/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/maestrano/connector-shopify/pulls/1","id":61581567,"html_url":"https://github.com/maestrano/connector-shopify/pull/1","diff_url":"https://github.com/maestrano/connector-shopify/pull/1.diff","patch_url":"https://github.com/maestrano/connector-shopify/pull/1.patch","issue_url":"https://api.github.com/repos/maestrano/connector-shopify/issues/1","number":1,"state":"open","locked":false,"title":"implemented connector shopify","user":{"login":"x4d3","id":4570217,"avatar_url":"https://avatars.githubusercontent.com/u/4570217?v=3","gravatar_id":"","url":"https://api.github.com/users/x4d3","html_url":"https://github.com/x4d3","followers_url":"https://api.github.com/users/x4d3/followers","following_url":"https://api.github.com/users/x4d3/following{/other_user}","gists_url":"https://api.github.com/users/x4d3/gists{/gist_id}","starred_url":"https://api.github.com/users/x4d3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/x4d3/subscriptions","organizations_url":"https://api.github.com/users/x4d3/orgs","repos_url":"https://api.github.com/users/x4d3/repos","events_url":"https://api.github.com/users/x4d3/events{/privacy}","received_events_url":"https://api.github.com/users/x4d3/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-03-03T16:05:20Z","updated_at":"2016-03-04T07:55:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6d81b1bb49d47d8e13d9f18039664f63910b4307","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/maestrano/connector-shopify/pulls/1/commits","review_comments_url":"https://api.github.com/repos/maestrano/connector-shopify/pulls/1/comments","review_comment_url":"https://api.github.com/repos/maestrano/connector-shopify/pulls/comments{/number}","comments_url":"https://api.github.com/repos/maestrano/connector-shopify/issues/1/comments","statuses_url":"https://api.github.com/repos/maestrano/connector-shopify/statuses/aacc2a0ffe20147c8af3b3b6e79688b431b97bbf","head":{"label":"x4d3:master","ref":"master","sha":"aacc2a0ffe20147c8af3b3b6e79688b431b97bbf","user":{"login":"x4d3","id":4570217,"avatar_url":"https://avatars.githubusercontent.com/u/4570217?v=3","gravatar_id":"","url":"https://api.github.com/users/x4d3","html_url":"https://github.com/x4d3","followers_url":"https://api.github.com/users/x4d3/followers","following_url":"https://api.github.com/users/x4d3/following{/other_user}","gists_url":"https://api.github.com/users/x4d3/gists{/gist_id}","starred_url":"https://api.github.com/users/x4d3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/x4d3/subscriptions","organizations_url":"https://api.github.com/users/x4d3/orgs","repos_url":"https://api.github.com/users/x4d3/repos","events_url":"https://api.github.com/users/x4d3/events{/privacy}","received_events_url":"https://api.github.com/users/x4d3/received_events","type":"User","site_admin":false},"repo":{"id":51831824,"name":"connector-shopify","full_name":"x4d3/connector-shopify","owner":{"login":"x4d3","id":4570217,"avatar_url":"https://avatars.githubusercontent.com/u/4570217?v=3","gravatar_id":"","url":"https://api.github.com/users/x4d3","html_url":"https://github.com/x4d3","followers_url":"https://api.github.com/users/x4d3/followers","following_url":"https://api.github.com/users/x4d3/following{/other_user}","gists_url":"https://api.github.com/users/x4d3/gists{/gist_id}","starred_url":"https://api.github.com/users/x4d3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/x4d3/subscriptions","organizations_url":"https://api.github.com/users/x4d3/orgs","repos_url":"https://api.github.com/users/x4d3/repos","events_url":"https://api.github.com/users/x4d3/events{/privacy}","received_events_url":"https://api.github.com/users/x4d3/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/x4d3/connector-shopify","description":"Connector for Shopify","fork":true,"url":"https://api.github.com/repos/x4d3/connector-shopify","forks_url":"https://api.github.com/repos/x4d3/connector-shopify/forks","keys_url":"https://api.github.com/repos/x4d3/connector-shopify/keys{/key_id}","collaborators_url":"https://api.github.com/repos/x4d3/connector-shopify/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/x4d3/connector-shopify/teams","hooks_url":"https://api.github.com/repos/x4d3/connector-shopify/hooks","issue_events_url":"https://api.github.com/repos/x4d3/connector-shopify/issues/events{/number}","events_url":"https://api.github.com/repos/x4d3/connector-shopify/events","assignees_url":"https://api.github.com/repos/x4d3/connector-shopify/assignees{/user}","branches_url":"https://api.github.com/repos/x4d3/connector-shopify/branches{/branch}","tags_url":"https://api.github.com/repos/x4d3/connector-shopify/tags","blobs_url":"https://api.github.com/repos/x4d3/connector-shopify/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/x4d3/connector-shopify/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/x4d3/connector-shopify/git/refs{/sha}","trees_url":"https://api.github.com/repos/x4d3/connector-shopify/git/trees{/sha}","statuses_url":"https://api.github.com/repos/x4d3/connector-shopify/statuses/{sha}","languages_url":"https://api.github.com/repos/x4d3/connector-shopify/languages","stargazers_url":"https://api.github.com/repos/x4d3/connector-shopify/stargazers","contributors_url":"https://api.github.com/repos/x4d3/connector-shopify/contributors","subscribers_url":"https://api.github.com/repos/x4d3/connector-shopify/subscribers","subscription_url":"https://api.github.com/repos/x4d3/connector-shopify/subscription","commits_url":"https://api.github.com/repos/x4d3/connector-shopify/commits{/sha}","git_commits_url":"https://api.github.com/repos/x4d3/connector-shopify/git/commits{/sha}","comments_url":"https://api.github.com/repos/x4d3/connector-shopify/comments{/number}","issue_comment_url":"https://api.github.com/repos/x4d3/connector-shopify/issues/comments{/number}","contents_url":"https://api.github.com/repos/x4d3/connector-shopify/contents/{+path}","compare_url":"https://api.github.com/repos/x4d3/connector-shopify/compare/{base}...{head}","merges_url":"https://api.github.com/repos/x4d3/connector-shopify/merges","archive_url":"https://api.github.com/repos/x4d3/connector-shopify/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/x4d3/connector-shopify/downloads","issues_url":"https://api.github.com/repos/x4d3/connector-shopify/issues{/number}","pulls_url":"https://api.github.com/repos/x4d3/connector-shopify/pulls{/number}","milestones_url":"https://api.github.com/repos/x4d3/connector-shopify/milestones{/number}","notifications_url":"https://api.github.com/repos/x4d3/connector-shopify/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/x4d3/connector-shopify/labels{/name}","releases_url":"https://api.github.com/repos/x4d3/connector-shopify/releases{/id}","deployments_url":"https://api.github.com/repos/x4d3/connector-shopify/deployments","created_at":"2016-02-16T11:41:53Z","updated_at":"2016-02-16T11:43:59Z","pushed_at":"2016-03-03T15:42:24Z","git_url":"git://github.com/x4d3/connector-shopify.git","ssh_url":"git@github.com:x4d3/connector-shopify.git","clone_url":"https://github.com/x4d3/connector-shopify.git","svn_url":"https://github.com/x4d3/connector-shopify","homepage":null,"size":329,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"maestrano:master","ref":"master","sha":"97b66fcf6575e697ddaed3633b818ddb208da549","user":{"login":"maestrano","id":6322021,"avatar_url":"https://avatars.githubusercontent.com/u/6322021?v=3","gravatar_id":"","url":"https://api.github.com/users/maestrano","html_url":"https://github.com/maestrano","followers_url":"https://api.github.com/users/maestrano/followers","following_url":"https://api.github.com/users/maestrano/following{/other_user}","gists_url":"https://api.github.com/users/maestrano/gists{/gist_id}","starred_url":"https://api.github.com/users/maestrano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maestrano/subscriptions","organizations_url":"https://api.github.com/users/maestrano/orgs","repos_url":"https://api.github.com/users/maestrano/repos","events_url":"https://api.github.com/users/maestrano/events{/privacy}","received_events_url":"https://api.github.com/users/maestrano/received_events","type":"Organization","site_admin":false},"repo":{"id":51831014,"name":"connector-shopify","full_name":"maestrano/connector-shopify","owner":{"login":"maestrano","id":6322021,"avatar_url":"https://avatars.githubusercontent.com/u/6322021?v=3","gravatar_id":"","url":"https://api.github.com/users/maestrano","html_url":"https://github.com/maestrano","followers_url":"https://api.github.com/users/maestrano/followers","following_url":"https://api.github.com/users/maestrano/following{/other_user}","gists_url":"https://api.github.com/users/maestrano/gists{/gist_id}","starred_url":"https://api.github.com/users/maestrano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maestrano/subscriptions","organizations_url":"https://api.github.com/users/maestrano/orgs","repos_url":"https://api.github.com/users/maestrano/repos","events_url":"https://api.github.com/users/maestrano/events{/privacy}","received_events_url":"https://api.github.com/users/maestrano/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/maestrano/connector-shopify","description":"Connector for Shopify","fork":false,"url":"https://api.github.com/repos/maestrano/connector-shopify","forks_url":"https://api.github.com/repos/maestrano/connector-shopify/forks","keys_url":"https://api.github.com/repos/maestrano/connector-shopify/keys{/key_id}","collaborators_url":"https://api.github.com/repos/maestrano/connector-shopify/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/maestrano/connector-shopify/teams","hooks_url":"https://api.github.com/repos/maestrano/connector-shopify/hooks","issue_events_url":"https://api.github.com/repos/maestrano/connector-shopify/issues/events{/number}","events_url":"https://api.github.com/repos/maestrano/connector-shopify/events","assignees_url":"https://api.github.com/repos/maestrano/connector-shopify/assignees{/user}","branches_url":"https://api.github.com/repos/maestrano/connector-shopify/branches{/branch}","tags_url":"https://api.github.com/repos/maestrano/connector-shopify/tags","blobs_url":"https://api.github.com/repos/maestrano/connector-shopify/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/maestrano/connector-shopify/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/maestrano/connector-shopify/git/refs{/sha}","trees_url":"https://api.github.com/repos/maestrano/connector-shopify/git/trees{/sha}","statuses_url":"https://api.github.com/repos/maestrano/connector-shopify/statuses/{sha}","languages_url":"https://api.github.com/repos/maestrano/connector-shopify/languages","stargazers_url":"https://api.github.com/repos/maestrano/connector-shopify/stargazers","contributors_url":"https://api.github.com/repos/maestrano/connector-shopify/contributors","subscribers_url":"https://api.github.com/repos/maestrano/connector-shopify/subscribers","subscription_url":"https://api.github.com/repos/maestrano/connector-shopify/subscription","commits_url":"https://api.github.com/repos/maestrano/connector-shopify/commits{/sha}","git_commits_url":"https://api.github.com/repos/maestrano/connector-shopify/git/commits{/sha}","comments_url":"https://api.github.com/repos/maestrano/connector-shopify/comments{/number}","issue_comment_url":"https://api.github.com/repos/maestrano/connector-shopify/issues/comments{/number}","contents_url":"https://api.github.com/repos/maestrano/connector-shopify/contents/{+path}","compare_url":"https://api.github.com/repos/maestrano/connector-shopify/compare/{base}...{head}","merges_url":"https://api.github.com/repos/maestrano/connector-shopify/merges","archive_url":"https://api.github.com/repos/maestrano/connector-shopify/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/maestrano/connector-shopify/downloads","issues_url":"https://api.github.com/repos/maestrano/connector-shopify/issues{/number}","pulls_url":"https://api.github.com/repos/maestrano/connector-shopify/pulls{/number}","milestones_url":"https://api.github.com/repos/maestrano/connector-shopify/milestones{/number}","notifications_url":"https://api.github.com/repos/maestrano/connector-shopify/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/maestrano/connector-shopify/labels{/name}","releases_url":"https://api.github.com/repos/maestrano/connector-shopify/releases{/id}","deployments_url":"https://api.github.com/repos/maestrano/connector-shopify/deployments","created_at":"2016-02-16T11:25:41Z","updated_at":"2016-02-16T11:38:07Z","pushed_at":"2016-03-03T16:05:20Z","git_url":"git://github.com/maestrano/connector-shopify.git","ssh_url":"git@github.com:maestrano/connector-shopify.git","clone_url":"https://github.com/maestrano/connector-shopify.git","svn_url":"https://github.com/maestrano/connector-shopify","homepage":null,"size":109,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/maestrano/connector-shopify/pulls/1"},"html":{"href":"https://github.com/maestrano/connector-shopify/pull/1"},"issue":{"href":"https://api.github.com/repos/maestrano/connector-shopify/issues/1"},"comments":{"href":"https://api.github.com/repos/maestrano/connector-shopify/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/maestrano/connector-shopify/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/maestrano/connector-shopify/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/maestrano/connector-shopify/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/maestrano/connector-shopify/statuses/aacc2a0ffe20147c8af3b3b6e79688b431b97bbf"}}}}