{"action":"created","comment":{"url":"https://api.github.com/repos/tablexi/nucore-open/pulls/comments/26714173","id":26714173,"diff_hunk":"@@ -664,6 +664,46 @@\n     expect(reservation).to be_can_start_early\n   end\n \n+  describe '#start_reservation!' do\n+    it 'sets actual start time', :timecop_freeze do\n+      reservation.start_reservation!\n+      expect(reservation.actual_start_at).to eq(Time.now)\n+    end\n+\n+    context 'with a running reservation' do\n+      let!(:running) { create :setup_reservation, product: instrument, reserve_start_at: (Time.now - 1.hour), reserve_end_at: Time.now, actual_start_at: (Time.now - 1.hour) }\n+      before do\n+        order = running.order_detail.order\n+        order.state = 'validated'\n+        order.purchase!\n+      end\n+\n+      it 'completes the running reservation' do\n+        reservation.start_reservation!\n+        expect(running.reload).to be_complete\n+      end\n+\n+      it 'sets the orders as a problem order' do","path":"spec/models/reservation_spec.rb","position":23,"original_position":23,"commit_id":"d0e4fff25b1174d4825cb2abe3c44d9ab53da1c1","original_commit_id":"d0e4fff25b1174d4825cb2abe3c44d9ab53da1c1","user":{"login":"jhanggi","id":1099111,"avatar_url":"https://avatars.githubusercontent.com/u/1099111?v=3","gravatar_id":"","url":"https://api.github.com/users/jhanggi","html_url":"https://github.com/jhanggi","followers_url":"https://api.github.com/users/jhanggi/followers","following_url":"https://api.github.com/users/jhanggi/following{/other_user}","gists_url":"https://api.github.com/users/jhanggi/gists{/gist_id}","starred_url":"https://api.github.com/users/jhanggi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhanggi/subscriptions","organizations_url":"https://api.github.com/users/jhanggi/orgs","repos_url":"https://api.github.com/users/jhanggi/repos","events_url":"https://api.github.com/users/jhanggi/events{/privacy}","received_events_url":"https://api.github.com/users/jhanggi/received_events","type":"User","site_admin":false},"body":"I would probably add a test that it doesn't set the actual_end_at of the previously-running reservation.","created_at":"2015-03-18T22:26:27Z","updated_at":"2015-03-18T22:26:27Z","html_url":"https://github.com/tablexi/nucore-open/pull/264#discussion_r26714173","pull_request_url":"https://api.github.com/repos/tablexi/nucore-open/pulls/264","_links":{"self":{"href":"https://api.github.com/repos/tablexi/nucore-open/pulls/comments/26714173"},"html":{"href":"https://github.com/tablexi/nucore-open/pull/264#discussion_r26714173"},"pull_request":{"href":"https://api.github.com/repos/tablexi/nucore-open/pulls/264"}}},"pull_request":{"url":"https://api.github.com/repos/tablexi/nucore-open/pulls/264","id":30950236,"html_url":"https://github.com/tablexi/nucore-open/pull/264","diff_url":"https://github.com/tablexi/nucore-open/pull/264.diff","patch_url":"https://github.com/tablexi/nucore-open/pull/264.patch","issue_url":"https://api.github.com/repos/tablexi/nucore-open/issues/264","number":264,"state":"open","locked":false,"title":"[#77963] End running reservations on an instrument before starting a new one","user":{"login":"jdzak","id":8027,"avatar_url":"https://avatars.githubusercontent.com/u/8027?v=3","gravatar_id":"","url":"https://api.github.com/users/jdzak","html_url":"https://github.com/jdzak","followers_url":"https://api.github.com/users/jdzak/followers","following_url":"https://api.github.com/users/jdzak/following{/other_user}","gists_url":"https://api.github.com/users/jdzak/gists{/gist_id}","starred_url":"https://api.github.com/users/jdzak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdzak/subscriptions","organizations_url":"https://api.github.com/users/jdzak/orgs","repos_url":"https://api.github.com/users/jdzak/repos","events_url":"https://api.github.com/users/jdzak/events{/privacy}","received_events_url":"https://api.github.com/users/jdzak/received_events","type":"User","site_admin":false},"body":"https://pm.tablexi.com/issues/77963","created_at":"2015-03-11T14:52:57Z","updated_at":"2015-03-18T22:26:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c0a74ea21f78e3ba9a259bda8f64aee35781db32","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/tablexi/nucore-open/pulls/264/commits","review_comments_url":"https://api.github.com/repos/tablexi/nucore-open/pulls/264/comments","review_comment_url":"https://api.github.com/repos/tablexi/nucore-open/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tablexi/nucore-open/issues/264/comments","statuses_url":"https://api.github.com/repos/tablexi/nucore-open/statuses/d0e4fff25b1174d4825cb2abe3c44d9ab53da1c1","head":{"label":"tablexi:77963-fix_end_reservation_relay_toggle","ref":"77963-fix_end_reservation_relay_toggle","sha":"d0e4fff25b1174d4825cb2abe3c44d9ab53da1c1","user":{"login":"tablexi","id":229702,"avatar_url":"https://avatars.githubusercontent.com/u/229702?v=3","gravatar_id":"","url":"https://api.github.com/users/tablexi","html_url":"https://github.com/tablexi","followers_url":"https://api.github.com/users/tablexi/followers","following_url":"https://api.github.com/users/tablexi/following{/other_user}","gists_url":"https://api.github.com/users/tablexi/gists{/gist_id}","starred_url":"https://api.github.com/users/tablexi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tablexi/subscriptions","organizations_url":"https://api.github.com/users/tablexi/orgs","repos_url":"https://api.github.com/users/tablexi/repos","events_url":"https://api.github.com/users/tablexi/events{/privacy}","received_events_url":"https://api.github.com/users/tablexi/received_events","type":"Organization","site_admin":false},"repo":{"id":1439473,"name":"nucore-open","full_name":"tablexi/nucore-open","owner":{"login":"tablexi","id":229702,"avatar_url":"https://avatars.githubusercontent.com/u/229702?v=3","gravatar_id":"","url":"https://api.github.com/users/tablexi","html_url":"https://github.com/tablexi","followers_url":"https://api.github.com/users/tablexi/followers","following_url":"https://api.github.com/users/tablexi/following{/other_user}","gists_url":"https://api.github.com/users/tablexi/gists{/gist_id}","starred_url":"https://api.github.com/users/tablexi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tablexi/subscriptions","organizations_url":"https://api.github.com/users/tablexi/orgs","repos_url":"https://api.github.com/users/tablexi/repos","events_url":"https://api.github.com/users/tablexi/events{/privacy}","received_events_url":"https://api.github.com/users/tablexi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tablexi/nucore-open","description":"Northwestern University Core Facility Management Software (NUCore)","fork":false,"url":"https://api.github.com/repos/tablexi/nucore-open","forks_url":"https://api.github.com/repos/tablexi/nucore-open/forks","keys_url":"https://api.github.com/repos/tablexi/nucore-open/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tablexi/nucore-open/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tablexi/nucore-open/teams","hooks_url":"https://api.github.com/repos/tablexi/nucore-open/hooks","issue_events_url":"https://api.github.com/repos/tablexi/nucore-open/issues/events{/number}","events_url":"https://api.github.com/repos/tablexi/nucore-open/events","assignees_url":"https://api.github.com/repos/tablexi/nucore-open/assignees{/user}","branches_url":"https://api.github.com/repos/tablexi/nucore-open/branches{/branch}","tags_url":"https://api.github.com/repos/tablexi/nucore-open/tags","blobs_url":"https://api.github.com/repos/tablexi/nucore-open/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tablexi/nucore-open/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tablexi/nucore-open/git/refs{/sha}","trees_url":"https://api.github.com/repos/tablexi/nucore-open/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tablexi/nucore-open/statuses/{sha}","languages_url":"https://api.github.com/repos/tablexi/nucore-open/languages","stargazers_url":"https://api.github.com/repos/tablexi/nucore-open/stargazers","contributors_url":"https://api.github.com/repos/tablexi/nucore-open/contributors","subscribers_url":"https://api.github.com/repos/tablexi/nucore-open/subscribers","subscription_url":"https://api.github.com/repos/tablexi/nucore-open/subscription","commits_url":"https://api.github.com/repos/tablexi/nucore-open/commits{/sha}","git_commits_url":"https://api.github.com/repos/tablexi/nucore-open/git/commits{/sha}","comments_url":"https://api.github.com/repos/tablexi/nucore-open/comments{/number}","issue_comment_url":"https://api.github.com/repos/tablexi/nucore-open/issues/comments{/number}","contents_url":"https://api.github.com/repos/tablexi/nucore-open/contents/{+path}","compare_url":"https://api.github.com/repos/tablexi/nucore-open/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tablexi/nucore-open/merges","archive_url":"https://api.github.com/repos/tablexi/nucore-open/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tablexi/nucore-open/downloads","issues_url":"https://api.github.com/repos/tablexi/nucore-open/issues{/number}","pulls_url":"https://api.github.com/repos/tablexi/nucore-open/pulls{/number}","milestones_url":"https://api.github.com/repos/tablexi/nucore-open/milestones{/number}","notifications_url":"https://api.github.com/repos/tablexi/nucore-open/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tablexi/nucore-open/labels{/name}","releases_url":"https://api.github.com/repos/tablexi/nucore-open/releases{/id}","created_at":"2011-03-04T13:45:37Z","updated_at":"2015-03-18T22:09:12Z","pushed_at":"2015-03-18T22:09:16Z","git_url":"git://github.com/tablexi/nucore-open.git","ssh_url":"git@github.com:tablexi/nucore-open.git","clone_url":"https://github.com/tablexi/nucore-open.git","svn_url":"https://github.com/tablexi/nucore-open","homepage":"","size":63044,"stargazers_count":3,"watchers_count":3,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":4,"forks":3,"open_issues":4,"watchers":3,"default_branch":"master"}},"base":{"label":"tablexi:master","ref":"master","sha":"4eb9304faac4e7baab3fdfadf593a7f17f8fc58f","user":{"login":"tablexi","id":229702,"avatar_url":"https://avatars.githubusercontent.com/u/229702?v=3","gravatar_id":"","url":"https://api.github.com/users/tablexi","html_url":"https://github.com/tablexi","followers_url":"https://api.github.com/users/tablexi/followers","following_url":"https://api.github.com/users/tablexi/following{/other_user}","gists_url":"https://api.github.com/users/tablexi/gists{/gist_id}","starred_url":"https://api.github.com/users/tablexi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tablexi/subscriptions","organizations_url":"https://api.github.com/users/tablexi/orgs","repos_url":"https://api.github.com/users/tablexi/repos","events_url":"https://api.github.com/users/tablexi/events{/privacy}","received_events_url":"https://api.github.com/users/tablexi/received_events","type":"Organization","site_admin":false},"repo":{"id":1439473,"name":"nucore-open","full_name":"tablexi/nucore-open","owner":{"login":"tablexi","id":229702,"avatar_url":"https://avatars.githubusercontent.com/u/229702?v=3","gravatar_id":"","url":"https://api.github.com/users/tablexi","html_url":"https://github.com/tablexi","followers_url":"https://api.github.com/users/tablexi/followers","following_url":"https://api.github.com/users/tablexi/following{/other_user}","gists_url":"https://api.github.com/users/tablexi/gists{/gist_id}","starred_url":"https://api.github.com/users/tablexi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tablexi/subscriptions","organizations_url":"https://api.github.com/users/tablexi/orgs","repos_url":"https://api.github.com/users/tablexi/repos","events_url":"https://api.github.com/users/tablexi/events{/privacy}","received_events_url":"https://api.github.com/users/tablexi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tablexi/nucore-open","description":"Northwestern University Core Facility Management Software (NUCore)","fork":false,"url":"https://api.github.com/repos/tablexi/nucore-open","forks_url":"https://api.github.com/repos/tablexi/nucore-open/forks","keys_url":"https://api.github.com/repos/tablexi/nucore-open/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tablexi/nucore-open/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tablexi/nucore-open/teams","hooks_url":"https://api.github.com/repos/tablexi/nucore-open/hooks","issue_events_url":"https://api.github.com/repos/tablexi/nucore-open/issues/events{/number}","events_url":"https://api.github.com/repos/tablexi/nucore-open/events","assignees_url":"https://api.github.com/repos/tablexi/nucore-open/assignees{/user}","branches_url":"https://api.github.com/repos/tablexi/nucore-open/branches{/branch}","tags_url":"https://api.github.com/repos/tablexi/nucore-open/tags","blobs_url":"https://api.github.com/repos/tablexi/nucore-open/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tablexi/nucore-open/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tablexi/nucore-open/git/refs{/sha}","trees_url":"https://api.github.com/repos/tablexi/nucore-open/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tablexi/nucore-open/statuses/{sha}","languages_url":"https://api.github.com/repos/tablexi/nucore-open/languages","stargazers_url":"https://api.github.com/repos/tablexi/nucore-open/stargazers","contributors_url":"https://api.github.com/repos/tablexi/nucore-open/contributors","subscribers_url":"https://api.github.com/repos/tablexi/nucore-open/subscribers","subscription_url":"https://api.github.com/repos/tablexi/nucore-open/subscription","commits_url":"https://api.github.com/repos/tablexi/nucore-open/commits{/sha}","git_commits_url":"https://api.github.com/repos/tablexi/nucore-open/git/commits{/sha}","comments_url":"https://api.github.com/repos/tablexi/nucore-open/comments{/number}","issue_comment_url":"https://api.github.com/repos/tablexi/nucore-open/issues/comments{/number}","contents_url":"https://api.github.com/repos/tablexi/nucore-open/contents/{+path}","compare_url":"https://api.github.com/repos/tablexi/nucore-open/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tablexi/nucore-open/merges","archive_url":"https://api.github.com/repos/tablexi/nucore-open/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tablexi/nucore-open/downloads","issues_url":"https://api.github.com/repos/tablexi/nucore-open/issues{/number}","pulls_url":"https://api.github.com/repos/tablexi/nucore-open/pulls{/number}","milestones_url":"https://api.github.com/repos/tablexi/nucore-open/milestones{/number}","notifications_url":"https://api.github.com/repos/tablexi/nucore-open/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tablexi/nucore-open/labels{/name}","releases_url":"https://api.github.com/repos/tablexi/nucore-open/releases{/id}","created_at":"2011-03-04T13:45:37Z","updated_at":"2015-03-18T22:09:12Z","pushed_at":"2015-03-18T22:09:16Z","git_url":"git://github.com/tablexi/nucore-open.git","ssh_url":"git@github.com:tablexi/nucore-open.git","clone_url":"https://github.com/tablexi/nucore-open.git","svn_url":"https://github.com/tablexi/nucore-open","homepage":"","size":63044,"stargazers_count":3,"watchers_count":3,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":4,"forks":3,"open_issues":4,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tablexi/nucore-open/pulls/264"},"html":{"href":"https://github.com/tablexi/nucore-open/pull/264"},"issue":{"href":"https://api.github.com/repos/tablexi/nucore-open/issues/264"},"comments":{"href":"https://api.github.com/repos/tablexi/nucore-open/issues/264/comments"},"review_comments":{"href":"https://api.github.com/repos/tablexi/nucore-open/pulls/264/comments"},"review_comment":{"href":"https://api.github.com/repos/tablexi/nucore-open/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tablexi/nucore-open/pulls/264/commits"},"statuses":{"href":"https://api.github.com/repos/tablexi/nucore-open/statuses/d0e4fff25b1174d4825cb2abe3c44d9ab53da1c1"}}}}