{"action":"created","comment":{"url":"https://api.github.com/repos/hr-dash/hr-dash/pulls/comments/61700722","id":61700722,"diff_hunk":"@@ -91,6 +107,40 @@\n       it { expect(response).to have_http_status :success }\n       it { expect(response).to render_template('monthly_reports/edit') }\n       it { expect(response.body).to match report.target_month.strftime('%Y年%m月') }\n+      it { expect(response.body).not_to match '先月の月報をコピー' }\n+    end\n+  end\n+\n+  describe '#copy GET /monthly_reports/copy' do\n+    context 'valid' do\n+      context 'If monthly report on the last month is not registered' do\n+        let(:params) { { target_month: Date.today.beginning_of_month } }\n+        before { get copy_monthly_reports_path params }\n+\n+        it { expect(response).to have_http_status :success }\n+        it { expect(response).to render_template('monthly_reports/new') }\n+        it { expect(response.body).not_to match '先月の月報をコピー' }\n+        it { expect(response.body).not_to match 'label class=\\\"btn btn-default active\\\"' }\n+      end\n+\n+      context 'If monthly report on the last month has been registered' do\n+        let!(:prev_monthly_report) { create(:monthly_report_tag).monthly_report }\n+        let(:params) { { target_month: prev_monthly_report.target_month.next_month.beginning_of_month } }\n+        before do\n+          login prev_monthly_report.user\n+          get copy_monthly_reports_path params\n+        end\n+\n+        it { expect(response).to have_http_status :success }\n+        it { expect(response).to render_template('monthly_reports/new') }\n+        it { expect(response.body).not_to match '先月の月報をコピー' }\n+        it { expect(response.body).to match 'label class=\\\"btn btn-default active\\\"' }","path":"spec/requests/monthly_report_spec.rb","position":60,"original_position":60,"commit_id":"9447a54c6bf6d8da2686a0d8a1097ebbe8030c75","original_commit_id":"9447a54c6bf6d8da2686a0d8a1097ebbe8030c75","user":{"login":"bakunyo","id":2487437,"avatar_url":"https://avatars.githubusercontent.com/u/2487437?v=3","gravatar_id":"","url":"https://api.github.com/users/bakunyo","html_url":"https://github.com/bakunyo","followers_url":"https://api.github.com/users/bakunyo/followers","following_url":"https://api.github.com/users/bakunyo/following{/other_user}","gists_url":"https://api.github.com/users/bakunyo/gists{/gist_id}","starred_url":"https://api.github.com/users/bakunyo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bakunyo/subscriptions","organizations_url":"https://api.github.com/users/bakunyo/orgs","repos_url":"https://api.github.com/users/bakunyo/repos","events_url":"https://api.github.com/users/bakunyo/events{/privacy}","received_events_url":"https://api.github.com/users/bakunyo/received_events","type":"User","site_admin":false},"body":"何かしらの担当工程がactiveになってるかどうかをチェックしてるんですかね…？\r\n今はフロント側のテストが細かいところまでできてないんで、おいおい強化していきましょう〜 💪 \r\n\r\nここだけ何のテストなのか不明なので、コメント書いておいてもらえると助かります！","created_at":"2016-05-02T03:55:24Z","updated_at":"2016-05-02T03:55:24Z","html_url":"https://github.com/hr-dash/hr-dash/pull/209#discussion_r61700722","pull_request_url":"https://api.github.com/repos/hr-dash/hr-dash/pulls/209","_links":{"self":{"href":"https://api.github.com/repos/hr-dash/hr-dash/pulls/comments/61700722"},"html":{"href":"https://github.com/hr-dash/hr-dash/pull/209#discussion_r61700722"},"pull_request":{"href":"https://api.github.com/repos/hr-dash/hr-dash/pulls/209"}}},"pull_request":{"url":"https://api.github.com/repos/hr-dash/hr-dash/pulls/209","id":68516664,"html_url":"https://github.com/hr-dash/hr-dash/pull/209","diff_url":"https://github.com/hr-dash/hr-dash/pull/209.diff","patch_url":"https://github.com/hr-dash/hr-dash/pull/209.patch","issue_url":"https://api.github.com/repos/hr-dash/hr-dash/issues/209","number":209,"state":"open","locked":false,"title":"Add the copy function the last month of the monthly report","user":{"login":"Nobuhiko-Kudo","id":10985267,"avatar_url":"https://avatars.githubusercontent.com/u/10985267?v=3","gravatar_id":"","url":"https://api.github.com/users/Nobuhiko-Kudo","html_url":"https://github.com/Nobuhiko-Kudo","followers_url":"https://api.github.com/users/Nobuhiko-Kudo/followers","following_url":"https://api.github.com/users/Nobuhiko-Kudo/following{/other_user}","gists_url":"https://api.github.com/users/Nobuhiko-Kudo/gists{/gist_id}","starred_url":"https://api.github.com/users/Nobuhiko-Kudo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nobuhiko-Kudo/subscriptions","organizations_url":"https://api.github.com/users/Nobuhiko-Kudo/orgs","repos_url":"https://api.github.com/users/Nobuhiko-Kudo/repos","events_url":"https://api.github.com/users/Nobuhiko-Kudo/events{/privacy}","received_events_url":"https://api.github.com/users/Nobuhiko-Kudo/received_events","type":"User","site_admin":false},"body":"先月の月報をコピーする機能を追加しました。\r\nとりあえず、 先月の月報の内容をまとめてコピーするようにしてます。\r\n\r\nレビューをお願いします。","created_at":"2016-05-02T02:23:22Z","updated_at":"2016-05-02T03:55:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c1ab795c17f4d21c532b2f1e95bb5422f410435a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/hr-dash/hr-dash/pulls/209/commits","review_comments_url":"https://api.github.com/repos/hr-dash/hr-dash/pulls/209/comments","review_comment_url":"https://api.github.com/repos/hr-dash/hr-dash/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hr-dash/hr-dash/issues/209/comments","statuses_url":"https://api.github.com/repos/hr-dash/hr-dash/statuses/9447a54c6bf6d8da2686a0d8a1097ebbe8030c75","head":{"label":"hr-dash:dev/182_copy_the_last_month_of_the_monthly_report","ref":"dev/182_copy_the_last_month_of_the_monthly_report","sha":"9447a54c6bf6d8da2686a0d8a1097ebbe8030c75","user":{"login":"hr-dash","id":14330339,"avatar_url":"https://avatars.githubusercontent.com/u/14330339?v=3","gravatar_id":"","url":"https://api.github.com/users/hr-dash","html_url":"https://github.com/hr-dash","followers_url":"https://api.github.com/users/hr-dash/followers","following_url":"https://api.github.com/users/hr-dash/following{/other_user}","gists_url":"https://api.github.com/users/hr-dash/gists{/gist_id}","starred_url":"https://api.github.com/users/hr-dash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hr-dash/subscriptions","organizations_url":"https://api.github.com/users/hr-dash/orgs","repos_url":"https://api.github.com/users/hr-dash/repos","events_url":"https://api.github.com/users/hr-dash/events{/privacy}","received_events_url":"https://api.github.com/users/hr-dash/received_events","type":"Organization","site_admin":false},"repo":{"id":42654368,"name":"hr-dash","full_name":"hr-dash/hr-dash","owner":{"login":"hr-dash","id":14330339,"avatar_url":"https://avatars.githubusercontent.com/u/14330339?v=3","gravatar_id":"","url":"https://api.github.com/users/hr-dash","html_url":"https://github.com/hr-dash","followers_url":"https://api.github.com/users/hr-dash/followers","following_url":"https://api.github.com/users/hr-dash/following{/other_user}","gists_url":"https://api.github.com/users/hr-dash/gists{/gist_id}","starred_url":"https://api.github.com/users/hr-dash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hr-dash/subscriptions","organizations_url":"https://api.github.com/users/hr-dash/orgs","repos_url":"https://api.github.com/users/hr-dash/repos","events_url":"https://api.github.com/users/hr-dash/events{/privacy}","received_events_url":"https://api.github.com/users/hr-dash/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hr-dash/hr-dash","description":"","fork":false,"url":"https://api.github.com/repos/hr-dash/hr-dash","forks_url":"https://api.github.com/repos/hr-dash/hr-dash/forks","keys_url":"https://api.github.com/repos/hr-dash/hr-dash/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hr-dash/hr-dash/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hr-dash/hr-dash/teams","hooks_url":"https://api.github.com/repos/hr-dash/hr-dash/hooks","issue_events_url":"https://api.github.com/repos/hr-dash/hr-dash/issues/events{/number}","events_url":"https://api.github.com/repos/hr-dash/hr-dash/events","assignees_url":"https://api.github.com/repos/hr-dash/hr-dash/assignees{/user}","branches_url":"https://api.github.com/repos/hr-dash/hr-dash/branches{/branch}","tags_url":"https://api.github.com/repos/hr-dash/hr-dash/tags","blobs_url":"https://api.github.com/repos/hr-dash/hr-dash/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hr-dash/hr-dash/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hr-dash/hr-dash/git/refs{/sha}","trees_url":"https://api.github.com/repos/hr-dash/hr-dash/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hr-dash/hr-dash/statuses/{sha}","languages_url":"https://api.github.com/repos/hr-dash/hr-dash/languages","stargazers_url":"https://api.github.com/repos/hr-dash/hr-dash/stargazers","contributors_url":"https://api.github.com/repos/hr-dash/hr-dash/contributors","subscribers_url":"https://api.github.com/repos/hr-dash/hr-dash/subscribers","subscription_url":"https://api.github.com/repos/hr-dash/hr-dash/subscription","commits_url":"https://api.github.com/repos/hr-dash/hr-dash/commits{/sha}","git_commits_url":"https://api.github.com/repos/hr-dash/hr-dash/git/commits{/sha}","comments_url":"https://api.github.com/repos/hr-dash/hr-dash/comments{/number}","issue_comment_url":"https://api.github.com/repos/hr-dash/hr-dash/issues/comments{/number}","contents_url":"https://api.github.com/repos/hr-dash/hr-dash/contents/{+path}","compare_url":"https://api.github.com/repos/hr-dash/hr-dash/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hr-dash/hr-dash/merges","archive_url":"https://api.github.com/repos/hr-dash/hr-dash/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hr-dash/hr-dash/downloads","issues_url":"https://api.github.com/repos/hr-dash/hr-dash/issues{/number}","pulls_url":"https://api.github.com/repos/hr-dash/hr-dash/pulls{/number}","milestones_url":"https://api.github.com/repos/hr-dash/hr-dash/milestones{/number}","notifications_url":"https://api.github.com/repos/hr-dash/hr-dash/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hr-dash/hr-dash/labels{/name}","releases_url":"https://api.github.com/repos/hr-dash/hr-dash/releases{/id}","deployments_url":"https://api.github.com/repos/hr-dash/hr-dash/deployments","created_at":"2015-09-17T12:15:06Z","updated_at":"2016-01-13T13:26:20Z","pushed_at":"2016-05-02T02:23:23Z","git_url":"git://github.com/hr-dash/hr-dash.git","ssh_url":"git@github.com:hr-dash/hr-dash.git","clone_url":"https://github.com/hr-dash/hr-dash.git","svn_url":"https://github.com/hr-dash/hr-dash","homepage":null,"size":664,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":33,"forks":0,"open_issues":33,"watchers":1,"default_branch":"develop"}},"base":{"label":"hr-dash:develop","ref":"develop","sha":"c829871964f964c75e2737d34eb22100cc1be0e4","user":{"login":"hr-dash","id":14330339,"avatar_url":"https://avatars.githubusercontent.com/u/14330339?v=3","gravatar_id":"","url":"https://api.github.com/users/hr-dash","html_url":"https://github.com/hr-dash","followers_url":"https://api.github.com/users/hr-dash/followers","following_url":"https://api.github.com/users/hr-dash/following{/other_user}","gists_url":"https://api.github.com/users/hr-dash/gists{/gist_id}","starred_url":"https://api.github.com/users/hr-dash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hr-dash/subscriptions","organizations_url":"https://api.github.com/users/hr-dash/orgs","repos_url":"https://api.github.com/users/hr-dash/repos","events_url":"https://api.github.com/users/hr-dash/events{/privacy}","received_events_url":"https://api.github.com/users/hr-dash/received_events","type":"Organization","site_admin":false},"repo":{"id":42654368,"name":"hr-dash","full_name":"hr-dash/hr-dash","owner":{"login":"hr-dash","id":14330339,"avatar_url":"https://avatars.githubusercontent.com/u/14330339?v=3","gravatar_id":"","url":"https://api.github.com/users/hr-dash","html_url":"https://github.com/hr-dash","followers_url":"https://api.github.com/users/hr-dash/followers","following_url":"https://api.github.com/users/hr-dash/following{/other_user}","gists_url":"https://api.github.com/users/hr-dash/gists{/gist_id}","starred_url":"https://api.github.com/users/hr-dash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hr-dash/subscriptions","organizations_url":"https://api.github.com/users/hr-dash/orgs","repos_url":"https://api.github.com/users/hr-dash/repos","events_url":"https://api.github.com/users/hr-dash/events{/privacy}","received_events_url":"https://api.github.com/users/hr-dash/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hr-dash/hr-dash","description":"","fork":false,"url":"https://api.github.com/repos/hr-dash/hr-dash","forks_url":"https://api.github.com/repos/hr-dash/hr-dash/forks","keys_url":"https://api.github.com/repos/hr-dash/hr-dash/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hr-dash/hr-dash/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hr-dash/hr-dash/teams","hooks_url":"https://api.github.com/repos/hr-dash/hr-dash/hooks","issue_events_url":"https://api.github.com/repos/hr-dash/hr-dash/issues/events{/number}","events_url":"https://api.github.com/repos/hr-dash/hr-dash/events","assignees_url":"https://api.github.com/repos/hr-dash/hr-dash/assignees{/user}","branches_url":"https://api.github.com/repos/hr-dash/hr-dash/branches{/branch}","tags_url":"https://api.github.com/repos/hr-dash/hr-dash/tags","blobs_url":"https://api.github.com/repos/hr-dash/hr-dash/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hr-dash/hr-dash/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hr-dash/hr-dash/git/refs{/sha}","trees_url":"https://api.github.com/repos/hr-dash/hr-dash/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hr-dash/hr-dash/statuses/{sha}","languages_url":"https://api.github.com/repos/hr-dash/hr-dash/languages","stargazers_url":"https://api.github.com/repos/hr-dash/hr-dash/stargazers","contributors_url":"https://api.github.com/repos/hr-dash/hr-dash/contributors","subscribers_url":"https://api.github.com/repos/hr-dash/hr-dash/subscribers","subscription_url":"https://api.github.com/repos/hr-dash/hr-dash/subscription","commits_url":"https://api.github.com/repos/hr-dash/hr-dash/commits{/sha}","git_commits_url":"https://api.github.com/repos/hr-dash/hr-dash/git/commits{/sha}","comments_url":"https://api.github.com/repos/hr-dash/hr-dash/comments{/number}","issue_comment_url":"https://api.github.com/repos/hr-dash/hr-dash/issues/comments{/number}","contents_url":"https://api.github.com/repos/hr-dash/hr-dash/contents/{+path}","compare_url":"https://api.github.com/repos/hr-dash/hr-dash/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hr-dash/hr-dash/merges","archive_url":"https://api.github.com/repos/hr-dash/hr-dash/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hr-dash/hr-dash/downloads","issues_url":"https://api.github.com/repos/hr-dash/hr-dash/issues{/number}","pulls_url":"https://api.github.com/repos/hr-dash/hr-dash/pulls{/number}","milestones_url":"https://api.github.com/repos/hr-dash/hr-dash/milestones{/number}","notifications_url":"https://api.github.com/repos/hr-dash/hr-dash/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hr-dash/hr-dash/labels{/name}","releases_url":"https://api.github.com/repos/hr-dash/hr-dash/releases{/id}","deployments_url":"https://api.github.com/repos/hr-dash/hr-dash/deployments","created_at":"2015-09-17T12:15:06Z","updated_at":"2016-01-13T13:26:20Z","pushed_at":"2016-05-02T02:23:23Z","git_url":"git://github.com/hr-dash/hr-dash.git","ssh_url":"git@github.com:hr-dash/hr-dash.git","clone_url":"https://github.com/hr-dash/hr-dash.git","svn_url":"https://github.com/hr-dash/hr-dash","homepage":null,"size":664,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":33,"forks":0,"open_issues":33,"watchers":1,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/hr-dash/hr-dash/pulls/209"},"html":{"href":"https://github.com/hr-dash/hr-dash/pull/209"},"issue":{"href":"https://api.github.com/repos/hr-dash/hr-dash/issues/209"},"comments":{"href":"https://api.github.com/repos/hr-dash/hr-dash/issues/209/comments"},"review_comments":{"href":"https://api.github.com/repos/hr-dash/hr-dash/pulls/209/comments"},"review_comment":{"href":"https://api.github.com/repos/hr-dash/hr-dash/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hr-dash/hr-dash/pulls/209/commits"},"statuses":{"href":"https://api.github.com/repos/hr-dash/hr-dash/statuses/9447a54c6bf6d8da2686a0d8a1097ebbe8030c75"}}}}