{"action":"created","comment":{"url":"https://api.github.com/repos/betagouv/tps/pulls/comments/258525012","pull_request_review_id":205811159,"id":258525012,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI1ODUyNTAxMg==","diff_hunk":"@@ -0,0 +1,51 @@\n+require 'rails_helper'\n+\n+describe 'shared/champs/piece_justificative/_pj_link.html.haml', type: :view do\n+  let(:champ) { create(:champ, :piece_justificative, :with_piece_justificative_file) }\n+  let(:virus_scan) { nil }\n+\n+  before do\n+    if virus_scan\n+      champ.update(virus_scan: virus_scan)\n+    end\n+  end\n+\n+  subject { render 'shared/champs/piece_justificative/pj_link', champ: champ, user_can_upload: false }\n+\n+  context 'when there is no anti-virus scan yet' do\n+    let(:virus_scan) { nil }\n+\n+    it 'allows to download the file' do\n+      expect(subject).to have_link(champ.piece_justificative_file.filename.to_s)\n+      expect(subject).to have_text('ce fichier n’a pas été analysé par notre antivirus')\n+    end\n+  end\n+\n+  context 'when the anti-virus scan is pending' do\n+    let(:virus_scan) { create(:virus_scan, :pending) }\n+\n+    it 'displays the filename, but doesn’t allow to download the file' do\n+      expect(subject).to have_text(champ.piece_justificative_file.filename.to_s)\n+      expect(subject).not_to have_link(champ.piece_justificative_file.filename.to_s)\n+      expect(subject).to have_text('analyse antivirus en cours')\n+    end\n+  end","path":"spec/views/shared/champs/piece_justificative/_pj_link.html.haml_spec.rb","position":32,"original_position":32,"commit_id":"0e1e033d1492ab7b218139173317cd076572ddb3","original_commit_id":"b07ff68edfac170e9984032f65bfb21de95b3559","user":{"login":"fredZen","id":356570,"node_id":"MDQ6VXNlcjM1NjU3MA==","avatar_url":"https://avatars3.githubusercontent.com/u/356570?v=4","gravatar_id":"","url":"https://api.github.com/users/fredZen","html_url":"https://github.com/fredZen","followers_url":"https://api.github.com/users/fredZen/followers","following_url":"https://api.github.com/users/fredZen/following{/other_user}","gists_url":"https://api.github.com/users/fredZen/gists{/gist_id}","starred_url":"https://api.github.com/users/fredZen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fredZen/subscriptions","organizations_url":"https://api.github.com/users/fredZen/orgs","repos_url":"https://api.github.com/users/fredZen/repos","events_url":"https://api.github.com/users/fredZen/events{/privacy}","received_events_url":"https://api.github.com/users/fredZen/received_events","type":"User","site_admin":false},"body":":bowing_man: ","created_at":"2019-02-20T15:08:11Z","updated_at":"2019-02-20T15:08:11Z","html_url":"https://github.com/betagouv/tps/pull/3481#discussion_r258525012","pull_request_url":"https://api.github.com/repos/betagouv/tps/pulls/3481","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/betagouv/tps/pulls/comments/258525012"},"html":{"href":"https://github.com/betagouv/tps/pull/3481#discussion_r258525012"},"pull_request":{"href":"https://api.github.com/repos/betagouv/tps/pulls/3481"}},"in_reply_to_id":258485445},"pull_request":{"url":"https://api.github.com/repos/betagouv/tps/pulls/3481","id":254630200,"node_id":"MDExOlB1bGxSZXF1ZXN0MjU0NjMwMjAw","html_url":"https://github.com/betagouv/tps/pull/3481","diff_url":"https://github.com/betagouv/tps/pull/3481.diff","patch_url":"https://github.com/betagouv/tps/pull/3481.patch","issue_url":"https://api.github.com/repos/betagouv/tps/issues/3481","number":3481,"state":"open","locked":false,"title":"pj_link: fix an exception when the scan is not associated yet","user":{"login":"kemenaran","id":179923,"node_id":"MDQ6VXNlcjE3OTkyMw==","avatar_url":"https://avatars3.githubusercontent.com/u/179923?v=4","gravatar_id":"","url":"https://api.github.com/users/kemenaran","html_url":"https://github.com/kemenaran","followers_url":"https://api.github.com/users/kemenaran/followers","following_url":"https://api.github.com/users/kemenaran/following{/other_user}","gists_url":"https://api.github.com/users/kemenaran/gists{/gist_id}","starred_url":"https://api.github.com/users/kemenaran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kemenaran/subscriptions","organizations_url":"https://api.github.com/users/kemenaran/orgs","repos_url":"https://api.github.com/users/kemenaran/repos","events_url":"https://api.github.com/users/kemenaran/events{/privacy}","received_events_url":"https://api.github.com/users/kemenaran/received_events","type":"User","site_admin":false},"body":"Corrige une exception introduite hier soir dans #3461 : quand le virus_scan n'est pas encore associé à une PJ, la vue plante.\r\n\r\nPour la peine j'ai rajouté des specs sur toute la vue.\r\n\r\nhttp://localhost:9006/sentry/ds-prod/issues/234/?environment=production","created_at":"2019-02-20T13:10:22Z","updated_at":"2019-02-20T15:08:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"84f1b4f08600740f3483e84437190c503dacf645","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/betagouv/tps/pulls/3481/commits","review_comments_url":"https://api.github.com/repos/betagouv/tps/pulls/3481/comments","review_comment_url":"https://api.github.com/repos/betagouv/tps/pulls/comments{/number}","comments_url":"https://api.github.com/repos/betagouv/tps/issues/3481/comments","statuses_url":"https://api.github.com/repos/betagouv/tps/statuses/0e1e033d1492ab7b218139173317cd076572ddb3","head":{"label":"betagouv:fix-pj-link","ref":"fix-pj-link","sha":"0e1e033d1492ab7b218139173317cd076572ddb3","user":{"login":"betagouv","id":7874148,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc4NzQxNDg=","avatar_url":"https://avatars0.githubusercontent.com/u/7874148?v=4","gravatar_id":"","url":"https://api.github.com/users/betagouv","html_url":"https://github.com/betagouv","followers_url":"https://api.github.com/users/betagouv/followers","following_url":"https://api.github.com/users/betagouv/following{/other_user}","gists_url":"https://api.github.com/users/betagouv/gists{/gist_id}","starred_url":"https://api.github.com/users/betagouv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/betagouv/subscriptions","organizations_url":"https://api.github.com/users/betagouv/orgs","repos_url":"https://api.github.com/users/betagouv/repos","events_url":"https://api.github.com/users/betagouv/events{/privacy}","received_events_url":"https://api.github.com/users/betagouv/received_events","type":"Organization","site_admin":false},"repo":{"id":44167674,"node_id":"MDEwOlJlcG9zaXRvcnk0NDE2NzY3NA==","name":"tps","full_name":"betagouv/tps","private":false,"owner":{"login":"betagouv","id":7874148,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc4NzQxNDg=","avatar_url":"https://avatars0.githubusercontent.com/u/7874148?v=4","gravatar_id":"","url":"https://api.github.com/users/betagouv","html_url":"https://github.com/betagouv","followers_url":"https://api.github.com/users/betagouv/followers","following_url":"https://api.github.com/users/betagouv/following{/other_user}","gists_url":"https://api.github.com/users/betagouv/gists{/gist_id}","starred_url":"https://api.github.com/users/betagouv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/betagouv/subscriptions","organizations_url":"https://api.github.com/users/betagouv/orgs","repos_url":"https://api.github.com/users/betagouv/repos","events_url":"https://api.github.com/users/betagouv/events{/privacy}","received_events_url":"https://api.github.com/users/betagouv/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/betagouv/tps","description":"Dématérialiser et simplifier les démarches administratives ","fork":false,"url":"https://api.github.com/repos/betagouv/tps","forks_url":"https://api.github.com/repos/betagouv/tps/forks","keys_url":"https://api.github.com/repos/betagouv/tps/keys{/key_id}","collaborators_url":"https://api.github.com/repos/betagouv/tps/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/betagouv/tps/teams","hooks_url":"https://api.github.com/repos/betagouv/tps/hooks","issue_events_url":"https://api.github.com/repos/betagouv/tps/issues/events{/number}","events_url":"https://api.github.com/repos/betagouv/tps/events","assignees_url":"https://api.github.com/repos/betagouv/tps/assignees{/user}","branches_url":"https://api.github.com/repos/betagouv/tps/branches{/branch}","tags_url":"https://api.github.com/repos/betagouv/tps/tags","blobs_url":"https://api.github.com/repos/betagouv/tps/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/betagouv/tps/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/betagouv/tps/git/refs{/sha}","trees_url":"https://api.github.com/repos/betagouv/tps/git/trees{/sha}","statuses_url":"https://api.github.com/repos/betagouv/tps/statuses/{sha}","languages_url":"https://api.github.com/repos/betagouv/tps/languages","stargazers_url":"https://api.github.com/repos/betagouv/tps/stargazers","contributors_url":"https://api.github.com/repos/betagouv/tps/contributors","subscribers_url":"https://api.github.com/repos/betagouv/tps/subscribers","subscription_url":"https://api.github.com/repos/betagouv/tps/subscription","commits_url":"https://api.github.com/repos/betagouv/tps/commits{/sha}","git_commits_url":"https://api.github.com/repos/betagouv/tps/git/commits{/sha}","comments_url":"https://api.github.com/repos/betagouv/tps/comments{/number}","issue_comment_url":"https://api.github.com/repos/betagouv/tps/issues/comments{/number}","contents_url":"https://api.github.com/repos/betagouv/tps/contents/{+path}","compare_url":"https://api.github.com/repos/betagouv/tps/compare/{base}...{head}","merges_url":"https://api.github.com/repos/betagouv/tps/merges","archive_url":"https://api.github.com/repos/betagouv/tps/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/betagouv/tps/downloads","issues_url":"https://api.github.com/repos/betagouv/tps/issues{/number}","pulls_url":"https://api.github.com/repos/betagouv/tps/pulls{/number}","milestones_url":"https://api.github.com/repos/betagouv/tps/milestones{/number}","notifications_url":"https://api.github.com/repos/betagouv/tps/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/betagouv/tps/labels{/name}","releases_url":"https://api.github.com/repos/betagouv/tps/releases{/id}","deployments_url":"https://api.github.com/repos/betagouv/tps/deployments","created_at":"2015-10-13T10:01:34Z","updated_at":"2019-02-20T10:23:42Z","pushed_at":"2019-02-20T14:22:59Z","git_url":"git://github.com/betagouv/tps.git","ssh_url":"git@github.com:betagouv/tps.git","clone_url":"https://github.com/betagouv/tps.git","svn_url":"https://github.com/betagouv/tps","homepage":"https://www.demarches-simplifiees.fr","size":25341,"stargazers_count":33,"watchers_count":33,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":24,"mirror_url":null,"archived":false,"open_issues_count":744,"license":null,"forks":24,"open_issues":744,"watchers":33,"default_branch":"dev"}},"base":{"label":"betagouv:dev","ref":"dev","sha":"c1b47adbc2d42e298f38f126efefe848d989ef50","user":{"login":"betagouv","id":7874148,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc4NzQxNDg=","avatar_url":"https://avatars0.githubusercontent.com/u/7874148?v=4","gravatar_id":"","url":"https://api.github.com/users/betagouv","html_url":"https://github.com/betagouv","followers_url":"https://api.github.com/users/betagouv/followers","following_url":"https://api.github.com/users/betagouv/following{/other_user}","gists_url":"https://api.github.com/users/betagouv/gists{/gist_id}","starred_url":"https://api.github.com/users/betagouv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/betagouv/subscriptions","organizations_url":"https://api.github.com/users/betagouv/orgs","repos_url":"https://api.github.com/users/betagouv/repos","events_url":"https://api.github.com/users/betagouv/events{/privacy}","received_events_url":"https://api.github.com/users/betagouv/received_events","type":"Organization","site_admin":false},"repo":{"id":44167674,"node_id":"MDEwOlJlcG9zaXRvcnk0NDE2NzY3NA==","name":"tps","full_name":"betagouv/tps","private":false,"owner":{"login":"betagouv","id":7874148,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc4NzQxNDg=","avatar_url":"https://avatars0.githubusercontent.com/u/7874148?v=4","gravatar_id":"","url":"https://api.github.com/users/betagouv","html_url":"https://github.com/betagouv","followers_url":"https://api.github.com/users/betagouv/followers","following_url":"https://api.github.com/users/betagouv/following{/other_user}","gists_url":"https://api.github.com/users/betagouv/gists{/gist_id}","starred_url":"https://api.github.com/users/betagouv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/betagouv/subscriptions","organizations_url":"https://api.github.com/users/betagouv/orgs","repos_url":"https://api.github.com/users/betagouv/repos","events_url":"https://api.github.com/users/betagouv/events{/privacy}","received_events_url":"https://api.github.com/users/betagouv/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/betagouv/tps","description":"Dématérialiser et simplifier les démarches administratives ","fork":false,"url":"https://api.github.com/repos/betagouv/tps","forks_url":"https://api.github.com/repos/betagouv/tps/forks","keys_url":"https://api.github.com/repos/betagouv/tps/keys{/key_id}","collaborators_url":"https://api.github.com/repos/betagouv/tps/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/betagouv/tps/teams","hooks_url":"https://api.github.com/repos/betagouv/tps/hooks","issue_events_url":"https://api.github.com/repos/betagouv/tps/issues/events{/number}","events_url":"https://api.github.com/repos/betagouv/tps/events","assignees_url":"https://api.github.com/repos/betagouv/tps/assignees{/user}","branches_url":"https://api.github.com/repos/betagouv/tps/branches{/branch}","tags_url":"https://api.github.com/repos/betagouv/tps/tags","blobs_url":"https://api.github.com/repos/betagouv/tps/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/betagouv/tps/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/betagouv/tps/git/refs{/sha}","trees_url":"https://api.github.com/repos/betagouv/tps/git/trees{/sha}","statuses_url":"https://api.github.com/repos/betagouv/tps/statuses/{sha}","languages_url":"https://api.github.com/repos/betagouv/tps/languages","stargazers_url":"https://api.github.com/repos/betagouv/tps/stargazers","contributors_url":"https://api.github.com/repos/betagouv/tps/contributors","subscribers_url":"https://api.github.com/repos/betagouv/tps/subscribers","subscription_url":"https://api.github.com/repos/betagouv/tps/subscription","commits_url":"https://api.github.com/repos/betagouv/tps/commits{/sha}","git_commits_url":"https://api.github.com/repos/betagouv/tps/git/commits{/sha}","comments_url":"https://api.github.com/repos/betagouv/tps/comments{/number}","issue_comment_url":"https://api.github.com/repos/betagouv/tps/issues/comments{/number}","contents_url":"https://api.github.com/repos/betagouv/tps/contents/{+path}","compare_url":"https://api.github.com/repos/betagouv/tps/compare/{base}...{head}","merges_url":"https://api.github.com/repos/betagouv/tps/merges","archive_url":"https://api.github.com/repos/betagouv/tps/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/betagouv/tps/downloads","issues_url":"https://api.github.com/repos/betagouv/tps/issues{/number}","pulls_url":"https://api.github.com/repos/betagouv/tps/pulls{/number}","milestones_url":"https://api.github.com/repos/betagouv/tps/milestones{/number}","notifications_url":"https://api.github.com/repos/betagouv/tps/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/betagouv/tps/labels{/name}","releases_url":"https://api.github.com/repos/betagouv/tps/releases{/id}","deployments_url":"https://api.github.com/repos/betagouv/tps/deployments","created_at":"2015-10-13T10:01:34Z","updated_at":"2019-02-20T10:23:42Z","pushed_at":"2019-02-20T14:22:59Z","git_url":"git://github.com/betagouv/tps.git","ssh_url":"git@github.com:betagouv/tps.git","clone_url":"https://github.com/betagouv/tps.git","svn_url":"https://github.com/betagouv/tps","homepage":"https://www.demarches-simplifiees.fr","size":25341,"stargazers_count":33,"watchers_count":33,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":24,"mirror_url":null,"archived":false,"open_issues_count":744,"license":null,"forks":24,"open_issues":744,"watchers":33,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/betagouv/tps/pulls/3481"},"html":{"href":"https://github.com/betagouv/tps/pull/3481"},"issue":{"href":"https://api.github.com/repos/betagouv/tps/issues/3481"},"comments":{"href":"https://api.github.com/repos/betagouv/tps/issues/3481/comments"},"review_comments":{"href":"https://api.github.com/repos/betagouv/tps/pulls/3481/comments"},"review_comment":{"href":"https://api.github.com/repos/betagouv/tps/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/betagouv/tps/pulls/3481/commits"},"statuses":{"href":"https://api.github.com/repos/betagouv/tps/statuses/0e1e033d1492ab7b218139173317cd076572ddb3"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"fredZen"}}