{"action":"created","comment":{"url":"https://api.github.com/repos/equalize-squad/equalize/pulls/comments/77410834","id":77410834,"diff_hunk":"@@ -0,0 +1,179 @@\n+require 'rails_helper'\n+\n+RSpec.describe RequirementsController do\n+  before(:all) do\n+    @user = create(:user, :confirmed)\n+    @project = create(:project, user: @user)\n+  end\n+\n+  before { sign_in @user }\n+\n+  let(:requirement_responses) do\n+    dynamic_form.fields.map do |field|\n+      {\n+        field_id: field.id,\n+        response: [field.real_default_value]\n+      }\n+    end\n+  end\n+\n+  let(:valid_attributes) do\n+    {\n+      dynamic_form_id: dynamic_form.id,\n+      requirement_responses_attributes: requirement_responses\n+    }\n+  end\n+\n+  let(:invalid_attributes) do\n+    {\n+      dynamic_form_id: dynamic_form.id,\n+      requirement_responses_attributes: [\n+        {\n+          response: nil\n+        }\n+      ]\n+    }\n+  end\n+\n+  let(:dynamic_form) { create(:dynamic_form, :with_every_type_of_field, segment: @project.segment) }\n+\n+  let(:requirement) { create(:requirement_filled, project: @project, dynamic_form: dynamic_form) }\n+\n+  describe \"GET #show\" do\n+    it \"assigns the requested requirement and the project whose it belongs to\" do\n+      get :show, params: { project_id: @project.to_param, id: requirement.to_param }\n+\n+      expect(assigns(:project)).to eq(@project)\n+      expect(assigns(:requirement)).to eq(requirement)\n+    end\n+  end\n+\n+  describe \"GET #new\" do\n+    it \"assigns a new requirement as @requirement and the project whose it belongs to\" do\n+      get :new, params: { project_id: @project.to_param, dynamic_form_id: dynamic_form.to_param }\n+\n+      expect(assigns(:project)).to eq(@project)\n+      expect(assigns(:dynamic_form)).to eq(requirement.dynamic_form)\n+      expect(assigns(:requirement)).to be_a_new(Requirement)\n+    end\n+  end\n+\n+  describe \"GET #edit\" do\n+    it \"assigns the requested requirement and the project whose it belongs to\" do\n+      get :edit, params: { project_id: @project.to_param, id: requirement.to_param }\n+\n+      expect(assigns(:project)).to eq(@project)\n+      expect(assigns(:dynamic_form)).to eq(requirement.dynamic_form)\n+      expect(assigns(:requirement)).to eq(requirement)\n+    end\n+  end\n+\n+  describe \"POST #create\" do\n+    context \"with valid params\" do\n+      it \"creates a new Project\" do\n+        expect do\n+          post :create, params: { project_id: @project.to_param, requirement: valid_attributes, dynamic_form_id: dynamic_form.to_param }\n+        end.to change(Requirement, :count).by(1)\n+      end\n+\n+      it \"redirects to the created requirement\" do\n+        post :create, params: { project_id: @project.to_param, requirement: valid_attributes, dynamic_form_id: dynamic_form.to_param }","path":"spec/controllers/requirements_controller_spec.rb","position":80,"original_position":80,"commit_id":"84ee16b7e69831a3782002abe0c571fdcba4f1af","original_commit_id":"84ee16b7e69831a3782002abe0c571fdcba4f1af","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":"Line is too long. [134/120]","created_at":"2016-09-02T20:57:10Z","updated_at":"2016-09-02T20:57:10Z","html_url":"https://github.com/equalize-squad/equalize/pull/49#discussion_r77410834","pull_request_url":"https://api.github.com/repos/equalize-squad/equalize/pulls/49","_links":{"self":{"href":"https://api.github.com/repos/equalize-squad/equalize/pulls/comments/77410834"},"html":{"href":"https://github.com/equalize-squad/equalize/pull/49#discussion_r77410834"},"pull_request":{"href":"https://api.github.com/repos/equalize-squad/equalize/pulls/49"}}},"pull_request":{"url":"https://api.github.com/repos/equalize-squad/equalize/pulls/49","id":79309678,"html_url":"https://github.com/equalize-squad/equalize/pull/49","diff_url":"https://github.com/equalize-squad/equalize/pull/49.diff","patch_url":"https://github.com/equalize-squad/equalize/pull/49.patch","issue_url":"https://api.github.com/repos/equalize-squad/equalize/issues/49","number":49,"state":"open","locked":false,"title":"Create a dynamic form feature","user":{"login":"ddomingues","id":2476690,"avatar_url":"https://avatars.githubusercontent.com/u/2476690?v=3","gravatar_id":"","url":"https://api.github.com/users/ddomingues","html_url":"https://github.com/ddomingues","followers_url":"https://api.github.com/users/ddomingues/followers","following_url":"https://api.github.com/users/ddomingues/following{/other_user}","gists_url":"https://api.github.com/users/ddomingues/gists{/gist_id}","starred_url":"https://api.github.com/users/ddomingues/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ddomingues/subscriptions","organizations_url":"https://api.github.com/users/ddomingues/orgs","repos_url":"https://api.github.com/users/ddomingues/repos","events_url":"https://api.github.com/users/ddomingues/events{/privacy}","received_events_url":"https://api.github.com/users/ddomingues/received_events","type":"User","site_admin":false},"body":"- [x] Field\r\n- [x] TextField\r\n- [x] TextAreaField\r\n- [x] SelectField\r\n- [x] ImageField\r\n- [x] CheckboxField\r\n- [x] RadioField","created_at":"2016-07-29T05:46:20Z","updated_at":"2016-09-02T20:57:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"82dbd04226fe13351948a9b67fd5321a43dedd1a","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/equalize-squad/equalize/pulls/49/commits","review_comments_url":"https://api.github.com/repos/equalize-squad/equalize/pulls/49/comments","review_comment_url":"https://api.github.com/repos/equalize-squad/equalize/pulls/comments{/number}","comments_url":"https://api.github.com/repos/equalize-squad/equalize/issues/49/comments","statuses_url":"https://api.github.com/repos/equalize-squad/equalize/statuses/84ee16b7e69831a3782002abe0c571fdcba4f1af","head":{"label":"equalize-squad:add-fields","ref":"add-fields","sha":"84ee16b7e69831a3782002abe0c571fdcba4f1af","user":{"login":"equalize-squad","id":16491313,"avatar_url":"https://avatars.githubusercontent.com/u/16491313?v=3","gravatar_id":"","url":"https://api.github.com/users/equalize-squad","html_url":"https://github.com/equalize-squad","followers_url":"https://api.github.com/users/equalize-squad/followers","following_url":"https://api.github.com/users/equalize-squad/following{/other_user}","gists_url":"https://api.github.com/users/equalize-squad/gists{/gist_id}","starred_url":"https://api.github.com/users/equalize-squad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/equalize-squad/subscriptions","organizations_url":"https://api.github.com/users/equalize-squad/orgs","repos_url":"https://api.github.com/users/equalize-squad/repos","events_url":"https://api.github.com/users/equalize-squad/events{/privacy}","received_events_url":"https://api.github.com/users/equalize-squad/received_events","type":"Organization","site_admin":false},"repo":{"id":48809447,"name":"equalize","full_name":"equalize-squad/equalize","owner":{"login":"equalize-squad","id":16491313,"avatar_url":"https://avatars.githubusercontent.com/u/16491313?v=3","gravatar_id":"","url":"https://api.github.com/users/equalize-squad","html_url":"https://github.com/equalize-squad","followers_url":"https://api.github.com/users/equalize-squad/followers","following_url":"https://api.github.com/users/equalize-squad/following{/other_user}","gists_url":"https://api.github.com/users/equalize-squad/gists{/gist_id}","starred_url":"https://api.github.com/users/equalize-squad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/equalize-squad/subscriptions","organizations_url":"https://api.github.com/users/equalize-squad/orgs","repos_url":"https://api.github.com/users/equalize-squad/repos","events_url":"https://api.github.com/users/equalize-squad/events{/privacy}","received_events_url":"https://api.github.com/users/equalize-squad/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/equalize-squad/equalize","description":"Awesome Web App to Manage Quality Systems","fork":false,"url":"https://api.github.com/repos/equalize-squad/equalize","forks_url":"https://api.github.com/repos/equalize-squad/equalize/forks","keys_url":"https://api.github.com/repos/equalize-squad/equalize/keys{/key_id}","collaborators_url":"https://api.github.com/repos/equalize-squad/equalize/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/equalize-squad/equalize/teams","hooks_url":"https://api.github.com/repos/equalize-squad/equalize/hooks","issue_events_url":"https://api.github.com/repos/equalize-squad/equalize/issues/events{/number}","events_url":"https://api.github.com/repos/equalize-squad/equalize/events","assignees_url":"https://api.github.com/repos/equalize-squad/equalize/assignees{/user}","branches_url":"https://api.github.com/repos/equalize-squad/equalize/branches{/branch}","tags_url":"https://api.github.com/repos/equalize-squad/equalize/tags","blobs_url":"https://api.github.com/repos/equalize-squad/equalize/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/equalize-squad/equalize/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/equalize-squad/equalize/git/refs{/sha}","trees_url":"https://api.github.com/repos/equalize-squad/equalize/git/trees{/sha}","statuses_url":"https://api.github.com/repos/equalize-squad/equalize/statuses/{sha}","languages_url":"https://api.github.com/repos/equalize-squad/equalize/languages","stargazers_url":"https://api.github.com/repos/equalize-squad/equalize/stargazers","contributors_url":"https://api.github.com/repos/equalize-squad/equalize/contributors","subscribers_url":"https://api.github.com/repos/equalize-squad/equalize/subscribers","subscription_url":"https://api.github.com/repos/equalize-squad/equalize/subscription","commits_url":"https://api.github.com/repos/equalize-squad/equalize/commits{/sha}","git_commits_url":"https://api.github.com/repos/equalize-squad/equalize/git/commits{/sha}","comments_url":"https://api.github.com/repos/equalize-squad/equalize/comments{/number}","issue_comment_url":"https://api.github.com/repos/equalize-squad/equalize/issues/comments{/number}","contents_url":"https://api.github.com/repos/equalize-squad/equalize/contents/{+path}","compare_url":"https://api.github.com/repos/equalize-squad/equalize/compare/{base}...{head}","merges_url":"https://api.github.com/repos/equalize-squad/equalize/merges","archive_url":"https://api.github.com/repos/equalize-squad/equalize/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/equalize-squad/equalize/downloads","issues_url":"https://api.github.com/repos/equalize-squad/equalize/issues{/number}","pulls_url":"https://api.github.com/repos/equalize-squad/equalize/pulls{/number}","milestones_url":"https://api.github.com/repos/equalize-squad/equalize/milestones{/number}","notifications_url":"https://api.github.com/repos/equalize-squad/equalize/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/equalize-squad/equalize/labels{/name}","releases_url":"https://api.github.com/repos/equalize-squad/equalize/releases{/id}","deployments_url":"https://api.github.com/repos/equalize-squad/equalize/deployments","created_at":"2015-12-30T16:28:35Z","updated_at":"2016-05-05T03:05:35Z","pushed_at":"2016-09-02T20:55:45Z","git_url":"git://github.com/equalize-squad/equalize.git","ssh_url":"git@github.com:equalize-squad/equalize.git","clone_url":"https://github.com/equalize-squad/equalize.git","svn_url":"https://github.com/equalize-squad/equalize","homepage":"https://equalizei.herokuapp.com/","size":4263,"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":32,"forks":0,"open_issues":32,"watchers":0,"default_branch":"master"}},"base":{"label":"equalize-squad:master","ref":"master","sha":"6f814ab452a8bae0a972ab051b170f393c19a1ed","user":{"login":"equalize-squad","id":16491313,"avatar_url":"https://avatars.githubusercontent.com/u/16491313?v=3","gravatar_id":"","url":"https://api.github.com/users/equalize-squad","html_url":"https://github.com/equalize-squad","followers_url":"https://api.github.com/users/equalize-squad/followers","following_url":"https://api.github.com/users/equalize-squad/following{/other_user}","gists_url":"https://api.github.com/users/equalize-squad/gists{/gist_id}","starred_url":"https://api.github.com/users/equalize-squad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/equalize-squad/subscriptions","organizations_url":"https://api.github.com/users/equalize-squad/orgs","repos_url":"https://api.github.com/users/equalize-squad/repos","events_url":"https://api.github.com/users/equalize-squad/events{/privacy}","received_events_url":"https://api.github.com/users/equalize-squad/received_events","type":"Organization","site_admin":false},"repo":{"id":48809447,"name":"equalize","full_name":"equalize-squad/equalize","owner":{"login":"equalize-squad","id":16491313,"avatar_url":"https://avatars.githubusercontent.com/u/16491313?v=3","gravatar_id":"","url":"https://api.github.com/users/equalize-squad","html_url":"https://github.com/equalize-squad","followers_url":"https://api.github.com/users/equalize-squad/followers","following_url":"https://api.github.com/users/equalize-squad/following{/other_user}","gists_url":"https://api.github.com/users/equalize-squad/gists{/gist_id}","starred_url":"https://api.github.com/users/equalize-squad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/equalize-squad/subscriptions","organizations_url":"https://api.github.com/users/equalize-squad/orgs","repos_url":"https://api.github.com/users/equalize-squad/repos","events_url":"https://api.github.com/users/equalize-squad/events{/privacy}","received_events_url":"https://api.github.com/users/equalize-squad/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/equalize-squad/equalize","description":"Awesome Web App to Manage Quality Systems","fork":false,"url":"https://api.github.com/repos/equalize-squad/equalize","forks_url":"https://api.github.com/repos/equalize-squad/equalize/forks","keys_url":"https://api.github.com/repos/equalize-squad/equalize/keys{/key_id}","collaborators_url":"https://api.github.com/repos/equalize-squad/equalize/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/equalize-squad/equalize/teams","hooks_url":"https://api.github.com/repos/equalize-squad/equalize/hooks","issue_events_url":"https://api.github.com/repos/equalize-squad/equalize/issues/events{/number}","events_url":"https://api.github.com/repos/equalize-squad/equalize/events","assignees_url":"https://api.github.com/repos/equalize-squad/equalize/assignees{/user}","branches_url":"https://api.github.com/repos/equalize-squad/equalize/branches{/branch}","tags_url":"https://api.github.com/repos/equalize-squad/equalize/tags","blobs_url":"https://api.github.com/repos/equalize-squad/equalize/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/equalize-squad/equalize/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/equalize-squad/equalize/git/refs{/sha}","trees_url":"https://api.github.com/repos/equalize-squad/equalize/git/trees{/sha}","statuses_url":"https://api.github.com/repos/equalize-squad/equalize/statuses/{sha}","languages_url":"https://api.github.com/repos/equalize-squad/equalize/languages","stargazers_url":"https://api.github.com/repos/equalize-squad/equalize/stargazers","contributors_url":"https://api.github.com/repos/equalize-squad/equalize/contributors","subscribers_url":"https://api.github.com/repos/equalize-squad/equalize/subscribers","subscription_url":"https://api.github.com/repos/equalize-squad/equalize/subscription","commits_url":"https://api.github.com/repos/equalize-squad/equalize/commits{/sha}","git_commits_url":"https://api.github.com/repos/equalize-squad/equalize/git/commits{/sha}","comments_url":"https://api.github.com/repos/equalize-squad/equalize/comments{/number}","issue_comment_url":"https://api.github.com/repos/equalize-squad/equalize/issues/comments{/number}","contents_url":"https://api.github.com/repos/equalize-squad/equalize/contents/{+path}","compare_url":"https://api.github.com/repos/equalize-squad/equalize/compare/{base}...{head}","merges_url":"https://api.github.com/repos/equalize-squad/equalize/merges","archive_url":"https://api.github.com/repos/equalize-squad/equalize/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/equalize-squad/equalize/downloads","issues_url":"https://api.github.com/repos/equalize-squad/equalize/issues{/number}","pulls_url":"https://api.github.com/repos/equalize-squad/equalize/pulls{/number}","milestones_url":"https://api.github.com/repos/equalize-squad/equalize/milestones{/number}","notifications_url":"https://api.github.com/repos/equalize-squad/equalize/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/equalize-squad/equalize/labels{/name}","releases_url":"https://api.github.com/repos/equalize-squad/equalize/releases{/id}","deployments_url":"https://api.github.com/repos/equalize-squad/equalize/deployments","created_at":"2015-12-30T16:28:35Z","updated_at":"2016-05-05T03:05:35Z","pushed_at":"2016-09-02T20:55:45Z","git_url":"git://github.com/equalize-squad/equalize.git","ssh_url":"git@github.com:equalize-squad/equalize.git","clone_url":"https://github.com/equalize-squad/equalize.git","svn_url":"https://github.com/equalize-squad/equalize","homepage":"https://equalizei.herokuapp.com/","size":4263,"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":32,"forks":0,"open_issues":32,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/equalize-squad/equalize/pulls/49"},"html":{"href":"https://github.com/equalize-squad/equalize/pull/49"},"issue":{"href":"https://api.github.com/repos/equalize-squad/equalize/issues/49"},"comments":{"href":"https://api.github.com/repos/equalize-squad/equalize/issues/49/comments"},"review_comments":{"href":"https://api.github.com/repos/equalize-squad/equalize/pulls/49/comments"},"review_comment":{"href":"https://api.github.com/repos/equalize-squad/equalize/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/equalize-squad/equalize/pulls/49/commits"},"statuses":{"href":"https://api.github.com/repos/equalize-squad/equalize/statuses/84ee16b7e69831a3782002abe0c571fdcba4f1af"}}}}
{"actor":{"display_login":"houndci-bot"}}