{"action":"created","comment":{"url":"https://api.github.com/repos/coolsnowmail/Depot/pulls/comments/93771560","pull_request_review_id":14304162,"id":93771560,"diff_hunk":"@@ -0,0 +1,139 @@\n+require \"rails_helper\"\n+\n+\n+RSpec.describe OrdersController, :type => :controller do\n+  let!(:user) { create(:user) }\n+  let!(:product) { create(:product) }\n+  let!(:order1) { create(:order) }\n+  let!(:order2) { create(:order) }\n+  let!(:line_item1) { create(:line_item) }\n+  let!(:line_item2) { create(:line_item) }\n+  let!(:cart) { create(:cart) }\n+\n+  context 'for index orders' do\n+    before(:each) do\n+      session[:user_id] = user.id\n+    end\n+\n+    it 'should render index template' do\n+      get :index\n+      expect(response).to render_template(:index)\n+    end\n+\n+    it 'should insure correct of @orders' do\n+      get :index\n+      expect(assigns(:orders)).to eq(Order.all)\n+    end\n+  end\n+\n+  context 'for show orders' do\n+    before(:each) do\n+      session[:user_id] = user.id\n+    end\n+\n+    it 'should render show template' do\n+      get :show, id: order1.id\n+      expect(response).to render_template(:show)\n+    end\n+\n+    it 'should insure correct of @order' do\n+      get :show, id: order1.id\n+      expect(assigns(:order)).to eq(order1)\n+    end\n+  end\n+\n+  context 'for new order' do\n+    before(:each) do\n+      session[:user_id] = user.id\n+    end\n+\n+    it 'should set cart for action create orders' do\n+      get :new\n+      expect(Cart.all.size).to eq(2)\n+      expect(flash[:notice]).to eq(\"Your cart is empty\")\n+    end\n+\n+    it 'should redirect to store_url' do\n+      get :new\n+      expect(response).to redirect_to(store_url)\n+    end\n+\n+    it 'should render new template order' do\n+      cart.line_items << line_item1\n+      cart.save","path":"spec/controllers/orders_controller_spec.rb","position":63,"original_position":63,"commit_id":"791bd8c69e849c091772a5d180ddbd0f5d66e3a5","original_commit_id":"791bd8c69e849c091772a5d180ddbd0f5d66e3a5","user":{"login":"reshetov","id":1003798,"avatar_url":"https://avatars.githubusercontent.com/u/1003798?v=3","gravatar_id":"","url":"https://api.github.com/users/reshetov","html_url":"https://github.com/reshetov","followers_url":"https://api.github.com/users/reshetov/followers","following_url":"https://api.github.com/users/reshetov/following{/other_user}","gists_url":"https://api.github.com/users/reshetov/gists{/gist_id}","starred_url":"https://api.github.com/users/reshetov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reshetov/subscriptions","organizations_url":"https://api.github.com/users/reshetov/orgs","repos_url":"https://api.github.com/users/reshetov/repos","events_url":"https://api.github.com/users/reshetov/events{/privacy}","received_events_url":"https://api.github.com/users/reshetov/received_events","type":"User","site_admin":false},"body":"Вот для этого и нужны фактории, чтобы не создавать объекты в тесте","created_at":"2016-12-23T14:34:19Z","updated_at":"2016-12-23T14:51:36Z","html_url":"https://github.com/coolsnowmail/Depot/pull/2#discussion_r93771560","pull_request_url":"https://api.github.com/repos/coolsnowmail/Depot/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/coolsnowmail/Depot/pulls/comments/93771560"},"html":{"href":"https://github.com/coolsnowmail/Depot/pull/2#discussion_r93771560"},"pull_request":{"href":"https://api.github.com/repos/coolsnowmail/Depot/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/coolsnowmail/Depot/pulls/2","id":99244066,"html_url":"https://github.com/coolsnowmail/Depot/pull/2","diff_url":"https://github.com/coolsnowmail/Depot/pull/2.diff","patch_url":"https://github.com/coolsnowmail/Depot/pull/2.patch","issue_url":"https://api.github.com/repos/coolsnowmail/Depot/issues/2","number":2,"state":"open","locked":false,"title":"Test study","user":{"login":"coolsnowmail","id":19538665,"avatar_url":"https://avatars.githubusercontent.com/u/19538665?v=3","gravatar_id":"","url":"https://api.github.com/users/coolsnowmail","html_url":"https://github.com/coolsnowmail","followers_url":"https://api.github.com/users/coolsnowmail/followers","following_url":"https://api.github.com/users/coolsnowmail/following{/other_user}","gists_url":"https://api.github.com/users/coolsnowmail/gists{/gist_id}","starred_url":"https://api.github.com/users/coolsnowmail/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coolsnowmail/subscriptions","organizations_url":"https://api.github.com/users/coolsnowmail/orgs","repos_url":"https://api.github.com/users/coolsnowmail/repos","events_url":"https://api.github.com/users/coolsnowmail/events{/privacy}","received_events_url":"https://api.github.com/users/coolsnowmail/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-12-23T13:46:36Z","updated_at":"2016-12-23T14:51:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"994fafdb1c44f5e3ffa4692a19e94accc6ba6703","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/coolsnowmail/Depot/pulls/2/commits","review_comments_url":"https://api.github.com/repos/coolsnowmail/Depot/pulls/2/comments","review_comment_url":"https://api.github.com/repos/coolsnowmail/Depot/pulls/comments{/number}","comments_url":"https://api.github.com/repos/coolsnowmail/Depot/issues/2/comments","statuses_url":"https://api.github.com/repos/coolsnowmail/Depot/statuses/791bd8c69e849c091772a5d180ddbd0f5d66e3a5","head":{"label":"coolsnowmail:test_study","ref":"test_study","sha":"791bd8c69e849c091772a5d180ddbd0f5d66e3a5","user":{"login":"coolsnowmail","id":19538665,"avatar_url":"https://avatars.githubusercontent.com/u/19538665?v=3","gravatar_id":"","url":"https://api.github.com/users/coolsnowmail","html_url":"https://github.com/coolsnowmail","followers_url":"https://api.github.com/users/coolsnowmail/followers","following_url":"https://api.github.com/users/coolsnowmail/following{/other_user}","gists_url":"https://api.github.com/users/coolsnowmail/gists{/gist_id}","starred_url":"https://api.github.com/users/coolsnowmail/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coolsnowmail/subscriptions","organizations_url":"https://api.github.com/users/coolsnowmail/orgs","repos_url":"https://api.github.com/users/coolsnowmail/repos","events_url":"https://api.github.com/users/coolsnowmail/events{/privacy}","received_events_url":"https://api.github.com/users/coolsnowmail/received_events","type":"User","site_admin":false},"repo":{"id":70399673,"name":"Depot","full_name":"coolsnowmail/Depot","owner":{"login":"coolsnowmail","id":19538665,"avatar_url":"https://avatars.githubusercontent.com/u/19538665?v=3","gravatar_id":"","url":"https://api.github.com/users/coolsnowmail","html_url":"https://github.com/coolsnowmail","followers_url":"https://api.github.com/users/coolsnowmail/followers","following_url":"https://api.github.com/users/coolsnowmail/following{/other_user}","gists_url":"https://api.github.com/users/coolsnowmail/gists{/gist_id}","starred_url":"https://api.github.com/users/coolsnowmail/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coolsnowmail/subscriptions","organizations_url":"https://api.github.com/users/coolsnowmail/orgs","repos_url":"https://api.github.com/users/coolsnowmail/repos","events_url":"https://api.github.com/users/coolsnowmail/events{/privacy}","received_events_url":"https://api.github.com/users/coolsnowmail/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/coolsnowmail/Depot","description":null,"fork":false,"url":"https://api.github.com/repos/coolsnowmail/Depot","forks_url":"https://api.github.com/repos/coolsnowmail/Depot/forks","keys_url":"https://api.github.com/repos/coolsnowmail/Depot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/coolsnowmail/Depot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/coolsnowmail/Depot/teams","hooks_url":"https://api.github.com/repos/coolsnowmail/Depot/hooks","issue_events_url":"https://api.github.com/repos/coolsnowmail/Depot/issues/events{/number}","events_url":"https://api.github.com/repos/coolsnowmail/Depot/events","assignees_url":"https://api.github.com/repos/coolsnowmail/Depot/assignees{/user}","branches_url":"https://api.github.com/repos/coolsnowmail/Depot/branches{/branch}","tags_url":"https://api.github.com/repos/coolsnowmail/Depot/tags","blobs_url":"https://api.github.com/repos/coolsnowmail/Depot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/coolsnowmail/Depot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/coolsnowmail/Depot/git/refs{/sha}","trees_url":"https://api.github.com/repos/coolsnowmail/Depot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/coolsnowmail/Depot/statuses/{sha}","languages_url":"https://api.github.com/repos/coolsnowmail/Depot/languages","stargazers_url":"https://api.github.com/repos/coolsnowmail/Depot/stargazers","contributors_url":"https://api.github.com/repos/coolsnowmail/Depot/contributors","subscribers_url":"https://api.github.com/repos/coolsnowmail/Depot/subscribers","subscription_url":"https://api.github.com/repos/coolsnowmail/Depot/subscription","commits_url":"https://api.github.com/repos/coolsnowmail/Depot/commits{/sha}","git_commits_url":"https://api.github.com/repos/coolsnowmail/Depot/git/commits{/sha}","comments_url":"https://api.github.com/repos/coolsnowmail/Depot/comments{/number}","issue_comment_url":"https://api.github.com/repos/coolsnowmail/Depot/issues/comments{/number}","contents_url":"https://api.github.com/repos/coolsnowmail/Depot/contents/{+path}","compare_url":"https://api.github.com/repos/coolsnowmail/Depot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/coolsnowmail/Depot/merges","archive_url":"https://api.github.com/repos/coolsnowmail/Depot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/coolsnowmail/Depot/downloads","issues_url":"https://api.github.com/repos/coolsnowmail/Depot/issues{/number}","pulls_url":"https://api.github.com/repos/coolsnowmail/Depot/pulls{/number}","milestones_url":"https://api.github.com/repos/coolsnowmail/Depot/milestones{/number}","notifications_url":"https://api.github.com/repos/coolsnowmail/Depot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/coolsnowmail/Depot/labels{/name}","releases_url":"https://api.github.com/repos/coolsnowmail/Depot/releases{/id}","deployments_url":"https://api.github.com/repos/coolsnowmail/Depot/deployments","created_at":"2016-10-09T11:50:07Z","updated_at":"2016-10-09T12:22:28Z","pushed_at":"2016-12-23T13:46:36Z","git_url":"git://github.com/coolsnowmail/Depot.git","ssh_url":"git@github.com:coolsnowmail/Depot.git","clone_url":"https://github.com/coolsnowmail/Depot.git","svn_url":"https://github.com/coolsnowmail/Depot","homepage":null,"size":170,"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":"coolsnowmail:master","ref":"master","sha":"8e840a0adeefcd39c997ed5ee7f6d24886952a55","user":{"login":"coolsnowmail","id":19538665,"avatar_url":"https://avatars.githubusercontent.com/u/19538665?v=3","gravatar_id":"","url":"https://api.github.com/users/coolsnowmail","html_url":"https://github.com/coolsnowmail","followers_url":"https://api.github.com/users/coolsnowmail/followers","following_url":"https://api.github.com/users/coolsnowmail/following{/other_user}","gists_url":"https://api.github.com/users/coolsnowmail/gists{/gist_id}","starred_url":"https://api.github.com/users/coolsnowmail/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coolsnowmail/subscriptions","organizations_url":"https://api.github.com/users/coolsnowmail/orgs","repos_url":"https://api.github.com/users/coolsnowmail/repos","events_url":"https://api.github.com/users/coolsnowmail/events{/privacy}","received_events_url":"https://api.github.com/users/coolsnowmail/received_events","type":"User","site_admin":false},"repo":{"id":70399673,"name":"Depot","full_name":"coolsnowmail/Depot","owner":{"login":"coolsnowmail","id":19538665,"avatar_url":"https://avatars.githubusercontent.com/u/19538665?v=3","gravatar_id":"","url":"https://api.github.com/users/coolsnowmail","html_url":"https://github.com/coolsnowmail","followers_url":"https://api.github.com/users/coolsnowmail/followers","following_url":"https://api.github.com/users/coolsnowmail/following{/other_user}","gists_url":"https://api.github.com/users/coolsnowmail/gists{/gist_id}","starred_url":"https://api.github.com/users/coolsnowmail/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coolsnowmail/subscriptions","organizations_url":"https://api.github.com/users/coolsnowmail/orgs","repos_url":"https://api.github.com/users/coolsnowmail/repos","events_url":"https://api.github.com/users/coolsnowmail/events{/privacy}","received_events_url":"https://api.github.com/users/coolsnowmail/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/coolsnowmail/Depot","description":null,"fork":false,"url":"https://api.github.com/repos/coolsnowmail/Depot","forks_url":"https://api.github.com/repos/coolsnowmail/Depot/forks","keys_url":"https://api.github.com/repos/coolsnowmail/Depot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/coolsnowmail/Depot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/coolsnowmail/Depot/teams","hooks_url":"https://api.github.com/repos/coolsnowmail/Depot/hooks","issue_events_url":"https://api.github.com/repos/coolsnowmail/Depot/issues/events{/number}","events_url":"https://api.github.com/repos/coolsnowmail/Depot/events","assignees_url":"https://api.github.com/repos/coolsnowmail/Depot/assignees{/user}","branches_url":"https://api.github.com/repos/coolsnowmail/Depot/branches{/branch}","tags_url":"https://api.github.com/repos/coolsnowmail/Depot/tags","blobs_url":"https://api.github.com/repos/coolsnowmail/Depot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/coolsnowmail/Depot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/coolsnowmail/Depot/git/refs{/sha}","trees_url":"https://api.github.com/repos/coolsnowmail/Depot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/coolsnowmail/Depot/statuses/{sha}","languages_url":"https://api.github.com/repos/coolsnowmail/Depot/languages","stargazers_url":"https://api.github.com/repos/coolsnowmail/Depot/stargazers","contributors_url":"https://api.github.com/repos/coolsnowmail/Depot/contributors","subscribers_url":"https://api.github.com/repos/coolsnowmail/Depot/subscribers","subscription_url":"https://api.github.com/repos/coolsnowmail/Depot/subscription","commits_url":"https://api.github.com/repos/coolsnowmail/Depot/commits{/sha}","git_commits_url":"https://api.github.com/repos/coolsnowmail/Depot/git/commits{/sha}","comments_url":"https://api.github.com/repos/coolsnowmail/Depot/comments{/number}","issue_comment_url":"https://api.github.com/repos/coolsnowmail/Depot/issues/comments{/number}","contents_url":"https://api.github.com/repos/coolsnowmail/Depot/contents/{+path}","compare_url":"https://api.github.com/repos/coolsnowmail/Depot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/coolsnowmail/Depot/merges","archive_url":"https://api.github.com/repos/coolsnowmail/Depot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/coolsnowmail/Depot/downloads","issues_url":"https://api.github.com/repos/coolsnowmail/Depot/issues{/number}","pulls_url":"https://api.github.com/repos/coolsnowmail/Depot/pulls{/number}","milestones_url":"https://api.github.com/repos/coolsnowmail/Depot/milestones{/number}","notifications_url":"https://api.github.com/repos/coolsnowmail/Depot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/coolsnowmail/Depot/labels{/name}","releases_url":"https://api.github.com/repos/coolsnowmail/Depot/releases{/id}","deployments_url":"https://api.github.com/repos/coolsnowmail/Depot/deployments","created_at":"2016-10-09T11:50:07Z","updated_at":"2016-10-09T12:22:28Z","pushed_at":"2016-12-23T13:46:36Z","git_url":"git://github.com/coolsnowmail/Depot.git","ssh_url":"git@github.com:coolsnowmail/Depot.git","clone_url":"https://github.com/coolsnowmail/Depot.git","svn_url":"https://github.com/coolsnowmail/Depot","homepage":null,"size":170,"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/coolsnowmail/Depot/pulls/2"},"html":{"href":"https://github.com/coolsnowmail/Depot/pull/2"},"issue":{"href":"https://api.github.com/repos/coolsnowmail/Depot/issues/2"},"comments":{"href":"https://api.github.com/repos/coolsnowmail/Depot/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/coolsnowmail/Depot/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/coolsnowmail/Depot/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/coolsnowmail/Depot/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/coolsnowmail/Depot/statuses/791bd8c69e849c091772a5d180ddbd0f5d66e3a5"}}}}
{"actor":{"display_login":"reshetov"}}