{"action":"created","comment":{"url":"https://api.github.com/repos/mxabierto/adela/pulls/comments/80160567","id":80160567,"diff_hunk":"@@ -1,33 +1,130 @@\n require 'spec_helper'\n \n describe Distribution do\n-  shared_examples 'a valid distribution' do\n-    it 'should be valid' do\n+  describe '#valid?' do\n+    let(:distribution) { create(:distribution) }\n+\n+    it 'should be valid with all the mandatory fields' do\n       expect(distribution).to be_valid\n     end\n+\n+    it 'should not be valid with a duplicated download_url' do\n+      new_distribution = build(:distribution, download_url: distribution.download_url)\n+      expect(new_distribution).not_to be_valid\n+    end\n+\n+    it 'should not be valid with a duplicated title' do\n+      new_distribution = build(:distribution, title: distribution.title)\n+      expect(new_distribution).not_to be_valid\n+    end\n   end\n \n-  context 'with all mandatory fields' do\n-    let(:distribution) { create(:distribution) }\n-    it_behaves_like 'a valid distribution'\n+  describe '#valid?(:ckan)' do\n+    let!(:distribution) { create(:distribution) }\n+\n+    it 'should be valid with all the mandatory fields' do\n+      expect(distribution).to be_valid(:ckan)\n+    end\n+\n+    it 'should not be valid without a title' do\n+      distribution.title = nil\n+      expect(distribution).not_to be_valid(:ckan)\n+    end\n+\n+    it 'should not be valid without a description' do\n+      distribution.description = nil\n+      expect(distribution).not_to be_valid(:ckan)\n+    end\n+\n+    it 'should not be valid without a download_url' do\n+      distribution.download_url = nil\n+      expect(distribution).not_to be_valid(:ckan)\n+    end\n+\n+    it 'should not be valid without a publish_date' do\n+      distribution.publish_date = nil\n+      expect(distribution).not_to be_valid(:ckan)\n+    end\n+\n+    it 'should not be valid without a format' do\n+      distribution.format = nil\n+      expect(distribution).not_to be_valid(:ckan)\n+    end\n+\n+    it 'should not be valid without a modified' do\n+      distribution.modified = nil\n+      expect(distribution).not_to be_valid(:ckan)\n+    end\n+\n+    it 'should not be valid without a temporal' do\n+      distribution.temporal = nil\n+      expect(distribution).not_to be_valid(:ckan)\n+    end\n+  end\n+\n+  describe '#as_csv' do\n+    let(:distribution) { create(:distribution_with_dataset) }\n+\n+    it 'should return the csv file hash attributes' do\n+      expect(distribution.as_csv(style: :inventory)).to eql(\n+        {","path":"spec/models/distribution_spec.rb","position":75,"original_position":75,"commit_id":"9ee9f487f2a1f8811048b319b6c5c8a6b9b59049","original_commit_id":"9ee9f487f2a1f8811048b319b6c5c8a6b9b59049","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Redundant curly braces around a hash parameter.","created_at":"2016-09-22T23:56:47Z","updated_at":"2016-09-22T23:56:47Z","html_url":"https://github.com/mxabierto/adela/pull/1070#discussion_r80160567","pull_request_url":"https://api.github.com/repos/mxabierto/adela/pulls/1070","_links":{"self":{"href":"https://api.github.com/repos/mxabierto/adela/pulls/comments/80160567"},"html":{"href":"https://github.com/mxabierto/adela/pull/1070#discussion_r80160567"},"pull_request":{"href":"https://api.github.com/repos/mxabierto/adela/pulls/1070"}}},"pull_request":{"url":"https://api.github.com/repos/mxabierto/adela/pulls/1070","id":86390162,"html_url":"https://github.com/mxabierto/adela/pull/1070","diff_url":"https://github.com/mxabierto/adela/pull/1070.diff","patch_url":"https://github.com/mxabierto/adela/pull/1070.patch","issue_url":"https://api.github.com/repos/mxabierto/adela/issues/1070","number":1070,"state":"open","locked":false,"title":"Feature: Secretarías","user":{"login":"babasbot","id":764518,"avatar_url":"https://avatars.githubusercontent.com/u/764518?v=3","gravatar_id":"","url":"https://api.github.com/users/babasbot","html_url":"https://github.com/babasbot","followers_url":"https://api.github.com/users/babasbot/followers","following_url":"https://api.github.com/users/babasbot/following{/other_user}","gists_url":"https://api.github.com/users/babasbot/gists{/gist_id}","starred_url":"https://api.github.com/users/babasbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/babasbot/subscriptions","organizations_url":"https://api.github.com/users/babasbot/orgs","repos_url":"https://api.github.com/users/babasbot/repos","events_url":"https://api.github.com/users/babasbot/events{/privacy}","received_events_url":"https://api.github.com/users/babasbot/received_events","type":"User","site_admin":false},"body":"# DEPENDE DEL PR #1067 \r\n### Changelog\r\n\r\n1. Se agrega la bandera de `ministry` para saber si una organización es una secretaría.\r\n1. Desde el administrador se pueden crear/editar organizaciones como secretarías.\r\n1. Las secretarías pueden agregar *Minutas del Subgrupo de Fomento al Uso*, en la sección de documentos.\r\n\r\n### How to test\r\n\r\n1. En el administrador de Adela, crear una organización como secretaría.\r\n1. En el administrador de Adela, editar una organización como secretaría.\r\n1. En la sección de documentos, subir una *Minutas del Subgrupo de Fomento al Uso*.\r\n\r\nCloses #1062 \r\nCloses #1063 \r\n","created_at":"2016-09-22T18:30:48Z","updated_at":"2016-09-22T23:56:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a8c17f027a04ba5834221fefd7a34922c1256e4d","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/mxabierto/adela/pulls/1070/commits","review_comments_url":"https://api.github.com/repos/mxabierto/adela/pulls/1070/comments","review_comment_url":"https://api.github.com/repos/mxabierto/adela/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mxabierto/adela/issues/1070/comments","statuses_url":"https://api.github.com/repos/mxabierto/adela/statuses/9ee9f487f2a1f8811048b319b6c5c8a6b9b59049","head":{"label":"mxabierto:feature/ministry-organizations","ref":"feature/ministry-organizations","sha":"9ee9f487f2a1f8811048b319b6c5c8a6b9b59049","user":{"login":"mxabierto","id":6219557,"avatar_url":"https://avatars.githubusercontent.com/u/6219557?v=3","gravatar_id":"","url":"https://api.github.com/users/mxabierto","html_url":"https://github.com/mxabierto","followers_url":"https://api.github.com/users/mxabierto/followers","following_url":"https://api.github.com/users/mxabierto/following{/other_user}","gists_url":"https://api.github.com/users/mxabierto/gists{/gist_id}","starred_url":"https://api.github.com/users/mxabierto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mxabierto/subscriptions","organizations_url":"https://api.github.com/users/mxabierto/orgs","repos_url":"https://api.github.com/users/mxabierto/repos","events_url":"https://api.github.com/users/mxabierto/events{/privacy}","received_events_url":"https://api.github.com/users/mxabierto/received_events","type":"Organization","site_admin":false},"repo":{"id":18847464,"name":"adela","full_name":"mxabierto/adela","owner":{"login":"mxabierto","id":6219557,"avatar_url":"https://avatars.githubusercontent.com/u/6219557?v=3","gravatar_id":"","url":"https://api.github.com/users/mxabierto","html_url":"https://github.com/mxabierto","followers_url":"https://api.github.com/users/mxabierto/followers","following_url":"https://api.github.com/users/mxabierto/following{/other_user}","gists_url":"https://api.github.com/users/mxabierto/gists{/gist_id}","starred_url":"https://api.github.com/users/mxabierto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mxabierto/subscriptions","organizations_url":"https://api.github.com/users/mxabierto/orgs","repos_url":"https://api.github.com/users/mxabierto/repos","events_url":"https://api.github.com/users/mxabierto/events{/privacy}","received_events_url":"https://api.github.com/users/mxabierto/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mxabierto/adela","description":"La administradora/aceleradora/automatizadora de la Apertura en México.","fork":false,"url":"https://api.github.com/repos/mxabierto/adela","forks_url":"https://api.github.com/repos/mxabierto/adela/forks","keys_url":"https://api.github.com/repos/mxabierto/adela/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mxabierto/adela/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mxabierto/adela/teams","hooks_url":"https://api.github.com/repos/mxabierto/adela/hooks","issue_events_url":"https://api.github.com/repos/mxabierto/adela/issues/events{/number}","events_url":"https://api.github.com/repos/mxabierto/adela/events","assignees_url":"https://api.github.com/repos/mxabierto/adela/assignees{/user}","branches_url":"https://api.github.com/repos/mxabierto/adela/branches{/branch}","tags_url":"https://api.github.com/repos/mxabierto/adela/tags","blobs_url":"https://api.github.com/repos/mxabierto/adela/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mxabierto/adela/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mxabierto/adela/git/refs{/sha}","trees_url":"https://api.github.com/repos/mxabierto/adela/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mxabierto/adela/statuses/{sha}","languages_url":"https://api.github.com/repos/mxabierto/adela/languages","stargazers_url":"https://api.github.com/repos/mxabierto/adela/stargazers","contributors_url":"https://api.github.com/repos/mxabierto/adela/contributors","subscribers_url":"https://api.github.com/repos/mxabierto/adela/subscribers","subscription_url":"https://api.github.com/repos/mxabierto/adela/subscription","commits_url":"https://api.github.com/repos/mxabierto/adela/commits{/sha}","git_commits_url":"https://api.github.com/repos/mxabierto/adela/git/commits{/sha}","comments_url":"https://api.github.com/repos/mxabierto/adela/comments{/number}","issue_comment_url":"https://api.github.com/repos/mxabierto/adela/issues/comments{/number}","contents_url":"https://api.github.com/repos/mxabierto/adela/contents/{+path}","compare_url":"https://api.github.com/repos/mxabierto/adela/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mxabierto/adela/merges","archive_url":"https://api.github.com/repos/mxabierto/adela/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mxabierto/adela/downloads","issues_url":"https://api.github.com/repos/mxabierto/adela/issues{/number}","pulls_url":"https://api.github.com/repos/mxabierto/adela/pulls{/number}","milestones_url":"https://api.github.com/repos/mxabierto/adela/milestones{/number}","notifications_url":"https://api.github.com/repos/mxabierto/adela/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mxabierto/adela/labels{/name}","releases_url":"https://api.github.com/repos/mxabierto/adela/releases{/id}","deployments_url":"https://api.github.com/repos/mxabierto/adela/deployments","created_at":"2014-04-16T16:41:26Z","updated_at":"2016-09-15T01:40:03Z","pushed_at":"2016-09-22T23:56:13Z","git_url":"git://github.com/mxabierto/adela.git","ssh_url":"git@github.com:mxabierto/adela.git","clone_url":"https://github.com/mxabierto/adela.git","svn_url":"https://github.com/mxabierto/adela","homepage":"http://adela.datos.gob.mx","size":5061,"stargazers_count":13,"watchers_count":13,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":98,"forks":13,"open_issues":98,"watchers":13,"default_branch":"master"}},"base":{"label":"mxabierto:adela-v2.1.x","ref":"adela-v2.1.x","sha":"c58dd3fb923f3c3e42b5ee35974189da4590bbc9","user":{"login":"mxabierto","id":6219557,"avatar_url":"https://avatars.githubusercontent.com/u/6219557?v=3","gravatar_id":"","url":"https://api.github.com/users/mxabierto","html_url":"https://github.com/mxabierto","followers_url":"https://api.github.com/users/mxabierto/followers","following_url":"https://api.github.com/users/mxabierto/following{/other_user}","gists_url":"https://api.github.com/users/mxabierto/gists{/gist_id}","starred_url":"https://api.github.com/users/mxabierto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mxabierto/subscriptions","organizations_url":"https://api.github.com/users/mxabierto/orgs","repos_url":"https://api.github.com/users/mxabierto/repos","events_url":"https://api.github.com/users/mxabierto/events{/privacy}","received_events_url":"https://api.github.com/users/mxabierto/received_events","type":"Organization","site_admin":false},"repo":{"id":18847464,"name":"adela","full_name":"mxabierto/adela","owner":{"login":"mxabierto","id":6219557,"avatar_url":"https://avatars.githubusercontent.com/u/6219557?v=3","gravatar_id":"","url":"https://api.github.com/users/mxabierto","html_url":"https://github.com/mxabierto","followers_url":"https://api.github.com/users/mxabierto/followers","following_url":"https://api.github.com/users/mxabierto/following{/other_user}","gists_url":"https://api.github.com/users/mxabierto/gists{/gist_id}","starred_url":"https://api.github.com/users/mxabierto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mxabierto/subscriptions","organizations_url":"https://api.github.com/users/mxabierto/orgs","repos_url":"https://api.github.com/users/mxabierto/repos","events_url":"https://api.github.com/users/mxabierto/events{/privacy}","received_events_url":"https://api.github.com/users/mxabierto/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mxabierto/adela","description":"La administradora/aceleradora/automatizadora de la Apertura en México.","fork":false,"url":"https://api.github.com/repos/mxabierto/adela","forks_url":"https://api.github.com/repos/mxabierto/adela/forks","keys_url":"https://api.github.com/repos/mxabierto/adela/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mxabierto/adela/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mxabierto/adela/teams","hooks_url":"https://api.github.com/repos/mxabierto/adela/hooks","issue_events_url":"https://api.github.com/repos/mxabierto/adela/issues/events{/number}","events_url":"https://api.github.com/repos/mxabierto/adela/events","assignees_url":"https://api.github.com/repos/mxabierto/adela/assignees{/user}","branches_url":"https://api.github.com/repos/mxabierto/adela/branches{/branch}","tags_url":"https://api.github.com/repos/mxabierto/adela/tags","blobs_url":"https://api.github.com/repos/mxabierto/adela/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mxabierto/adela/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mxabierto/adela/git/refs{/sha}","trees_url":"https://api.github.com/repos/mxabierto/adela/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mxabierto/adela/statuses/{sha}","languages_url":"https://api.github.com/repos/mxabierto/adela/languages","stargazers_url":"https://api.github.com/repos/mxabierto/adela/stargazers","contributors_url":"https://api.github.com/repos/mxabierto/adela/contributors","subscribers_url":"https://api.github.com/repos/mxabierto/adela/subscribers","subscription_url":"https://api.github.com/repos/mxabierto/adela/subscription","commits_url":"https://api.github.com/repos/mxabierto/adela/commits{/sha}","git_commits_url":"https://api.github.com/repos/mxabierto/adela/git/commits{/sha}","comments_url":"https://api.github.com/repos/mxabierto/adela/comments{/number}","issue_comment_url":"https://api.github.com/repos/mxabierto/adela/issues/comments{/number}","contents_url":"https://api.github.com/repos/mxabierto/adela/contents/{+path}","compare_url":"https://api.github.com/repos/mxabierto/adela/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mxabierto/adela/merges","archive_url":"https://api.github.com/repos/mxabierto/adela/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mxabierto/adela/downloads","issues_url":"https://api.github.com/repos/mxabierto/adela/issues{/number}","pulls_url":"https://api.github.com/repos/mxabierto/adela/pulls{/number}","milestones_url":"https://api.github.com/repos/mxabierto/adela/milestones{/number}","notifications_url":"https://api.github.com/repos/mxabierto/adela/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mxabierto/adela/labels{/name}","releases_url":"https://api.github.com/repos/mxabierto/adela/releases{/id}","deployments_url":"https://api.github.com/repos/mxabierto/adela/deployments","created_at":"2014-04-16T16:41:26Z","updated_at":"2016-09-15T01:40:03Z","pushed_at":"2016-09-22T23:56:13Z","git_url":"git://github.com/mxabierto/adela.git","ssh_url":"git@github.com:mxabierto/adela.git","clone_url":"https://github.com/mxabierto/adela.git","svn_url":"https://github.com/mxabierto/adela","homepage":"http://adela.datos.gob.mx","size":5061,"stargazers_count":13,"watchers_count":13,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":98,"forks":13,"open_issues":98,"watchers":13,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mxabierto/adela/pulls/1070"},"html":{"href":"https://github.com/mxabierto/adela/pull/1070"},"issue":{"href":"https://api.github.com/repos/mxabierto/adela/issues/1070"},"comments":{"href":"https://api.github.com/repos/mxabierto/adela/issues/1070/comments"},"review_comments":{"href":"https://api.github.com/repos/mxabierto/adela/pulls/1070/comments"},"review_comment":{"href":"https://api.github.com/repos/mxabierto/adela/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mxabierto/adela/pulls/1070/commits"},"statuses":{"href":"https://api.github.com/repos/mxabierto/adela/statuses/9ee9f487f2a1f8811048b319b6c5c8a6b9b59049"}}}}
{"actor":{"display_login":"houndci-bot"}}