{"action":"created","comment":{"url":"https://api.github.com/repos/opf/openproject/pulls/comments/24260306","id":24260306,"diff_hunk":"@@ -0,0 +1,443 @@\n+#-- encoding: UTF-8\n+#-- copyright\n+# OpenProject is a project management system.\n+# Copyright (C) 2012-2015 the OpenProject Foundation (OPF)\n+#\n+# This program is free software; you can redistribute it and/or\n+# modify it under the terms of the GNU General Public License version 3.\n+#\n+# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:\n+# Copyright (C) 2006-2013 Jean-Philippe Lang\n+# Copyright (C) 2010-2013 the ChiliProject Team\n+#\n+# This program is free software; you can redistribute it and/or\n+# modify it under the terms of the GNU General Public License\n+# as published by the Free Software Foundation; either version 2\n+# of the License, or (at your option) any later version.\n+#\n+# This program is distributed in the hope that it will be useful,\n+# but WITHOUT ANY WARRANTY; without even the implied warranty of\n+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n+# GNU General Public License for more details.\n+#\n+# You should have received a copy of the GNU General Public License\n+# along with this program; if not, write to the Free Software\n+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.\n+#\n+# See doc/COPYRIGHT.rdoc for more details.\n+#++\n+require 'spec_helper'\n+require 'ostruct'\n+\n+TestViewHelper = Class.new(ActionView::Base)\n+\n+describe TabularFormBuilder do\n+  include Capybara::RSpecMatchers\n+\n+  let(:helper)   { TestViewHelper.new }\n+  let(:resource) {\n+    FactoryGirl.build(:user,\n+                      firstname:  'JJ',\n+                      lastname:   'Abrams',\n+                      login:      'lost',\n+                      mail:       'jj@lost-mail.com',\n+                      failed_login_count: 45)\n+  }\n+  let(:builder)  { TabularFormBuilder.new(:user, resource, helper, {}, nil) }\n+\n+  describe '#text_field' do\n+    let(:options) { { title: 'Name', class: 'custom-class' } }\n+\n+    subject(:output) {\n+      builder.text_field :name, options\n+    }\n+\n+    it_behaves_like 'labelled by default'\n+\n+    context 'with single_locale option' do\n+      let(:options)   { { single_locale: true } }\n+      let(:resource)  { FactoryGirl.build(:custom_field) }\n+\n+      it_behaves_like 'wrapped in field-container by default'\n+      it_behaves_like 'wrapped in container', 'text-field-container'\n+\n+      it 'should output element' do\n+        expect(output).to include %{\n+          <input class=\"form--text-field\"\n+            id=\"user_translations_attributes_0_name\"\n+            name=\"user[translations_attributes][0][name]\" no_label=\"true\" size=\"30\" type=\"text\" />\n+        }.squish\n+      end\n+    end\n+\n+    context 'with multi_locale option' do\n+      let(:options)   { { multi_locale: true } }\n+      let(:resource)  { FactoryGirl.build(:custom_field) }\n+\n+      it_behaves_like 'wrapped in field-container by default'\n+      it_behaves_like 'wrapped in container', 'text-field-container'\n+\n+      it 'should output element' do\n+        expect(output).to include %{\n+          <input class=\"form--text-field\"\n+            id=\"user_translations_attributes_0_name\"\n+            name=\"user[translations_attributes][0][name]\" no_label=\"true\" size=\"30\" type=\"text\" />\n+        }.squish\n+      end\n+\n+      it 'should output select' do\n+        expect(output).to have_selector 'select.locale_selector > option', count: 1\n+      end\n+\n+      it 'should have a link to add a locale' do\n+        expect(output).to include %{<a class=\"form--field-extra-actions add_locale\" href=\"#\">Add</a>}","path":"spec/lib/tabular_form_builder_spec.rb","position":93,"original_position":93,"commit_id":"b2f6d5c58e467c859b79caca258d2fd2a1d77f5d","original_commit_id":"b2f6d5c58e467c859b79caca258d2fd2a1d77f5d","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Line is too long. [101/99]","created_at":"2015-02-06T18:28:09Z","updated_at":"2015-02-06T18:28:09Z","html_url":"https://github.com/opf/openproject/pull/2492#discussion_r24260306","pull_request_url":"https://api.github.com/repos/opf/openproject/pulls/2492","_links":{"self":{"href":"https://api.github.com/repos/opf/openproject/pulls/comments/24260306"},"html":{"href":"https://github.com/opf/openproject/pull/2492#discussion_r24260306"},"pull_request":{"href":"https://api.github.com/repos/opf/openproject/pulls/2492"}}},"pull_request":{"url":"https://api.github.com/repos/opf/openproject/pulls/2492","id":28486191,"html_url":"https://github.com/opf/openproject/pull/2492","diff_url":"https://github.com/opf/openproject/pull/2492.diff","patch_url":"https://github.com/opf/openproject/pull/2492.patch","issue_url":"https://api.github.com/repos/opf/openproject/issues/2492","number":2492,"state":"open","locked":false,"title":"18329 Forms refactor based on Foundation for Apps","user":{"login":"myabc","id":755,"avatar_url":"https://avatars.githubusercontent.com/u/755?v=3","gravatar_id":"","url":"https://api.github.com/users/myabc","html_url":"https://github.com/myabc","followers_url":"https://api.github.com/users/myabc/followers","following_url":"https://api.github.com/users/myabc/following{/other_user}","gists_url":"https://api.github.com/users/myabc/gists{/gist_id}","starred_url":"https://api.github.com/users/myabc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/myabc/subscriptions","organizations_url":"https://api.github.com/users/myabc/orgs","repos_url":"https://api.github.com/users/myabc/repos","events_url":"https://api.github.com/users/myabc/events{/privacy}","received_events_url":"https://api.github.com/users/myabc/received_events","type":"User","site_admin":false},"body":"https://community.openproject.org/work_packages/18329\r\n\r\nContinuation of #2294.\r\n\r\n- [x] Update, test TabularFormBuilder\r\n- [ ] Use TabularFormBuilder throughout application - @ulferts<br/> \r\n       (i.e. make default)\r\n- [x] Refactor, cleanup TabularFormBuilder\r\n- [ ] Display Rails form errors correctly<br/> \r\n       (adapt or remove `ActionView::Base.wrap_with_error_span` monkey patch)\r\n- [ ] Update helpers generating forms\r\n  - [ ] CustomFieldsHelper \r\n  - [ ] ProjectsHelper\r\n  - [x] SettingsHelper - @myabc\r\n- [ ] Update views\r\n  - [ ] Work Packages\r\n  - [ ] News\r\n  - [ ] Wiki @floriank\r\n  - [ ] Status Reportings \r\n- [ ] Update OP plugins\r\n\r\n---","created_at":"2015-02-02T17:27:19Z","updated_at":"2015-02-06T18:28:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"edfc4f798da7063c61c7d34f79b3235cffcf42a3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/opf/openproject/pulls/2492/commits","review_comments_url":"https://api.github.com/repos/opf/openproject/pulls/2492/comments","review_comment_url":"https://api.github.com/repos/opf/openproject/pulls/comments/{number}","comments_url":"https://api.github.com/repos/opf/openproject/issues/2492/comments","statuses_url":"https://api.github.com/repos/opf/openproject/statuses/b2f6d5c58e467c859b79caca258d2fd2a1d77f5d","head":{"label":"opf:feature/18329-foundation-apps-framework-forms-refactor","ref":"feature/18329-foundation-apps-framework-forms-refactor","sha":"b2f6d5c58e467c859b79caca258d2fd2a1d77f5d","user":{"login":"opf","id":1756674,"avatar_url":"https://avatars.githubusercontent.com/u/1756674?v=3","gravatar_id":"","url":"https://api.github.com/users/opf","html_url":"https://github.com/opf","followers_url":"https://api.github.com/users/opf/followers","following_url":"https://api.github.com/users/opf/following{/other_user}","gists_url":"https://api.github.com/users/opf/gists{/gist_id}","starred_url":"https://api.github.com/users/opf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opf/subscriptions","organizations_url":"https://api.github.com/users/opf/orgs","repos_url":"https://api.github.com/users/opf/repos","events_url":"https://api.github.com/users/opf/events{/privacy}","received_events_url":"https://api.github.com/users/opf/received_events","type":"Organization","site_admin":false},"repo":{"id":6899875,"name":"openproject","full_name":"opf/openproject","owner":{"login":"opf","id":1756674,"avatar_url":"https://avatars.githubusercontent.com/u/1756674?v=3","gravatar_id":"","url":"https://api.github.com/users/opf","html_url":"https://github.com/opf","followers_url":"https://api.github.com/users/opf/followers","following_url":"https://api.github.com/users/opf/following{/other_user}","gists_url":"https://api.github.com/users/opf/gists{/gist_id}","starred_url":"https://api.github.com/users/opf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opf/subscriptions","organizations_url":"https://api.github.com/users/opf/orgs","repos_url":"https://api.github.com/users/opf/repos","events_url":"https://api.github.com/users/opf/events{/privacy}","received_events_url":"https://api.github.com/users/opf/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/opf/openproject","description":"OpenProject is a web-based project management system built on Ruby on Rails","fork":false,"url":"https://api.github.com/repos/opf/openproject","forks_url":"https://api.github.com/repos/opf/openproject/forks","keys_url":"https://api.github.com/repos/opf/openproject/keys{/key_id}","collaborators_url":"https://api.github.com/repos/opf/openproject/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/opf/openproject/teams","hooks_url":"https://api.github.com/repos/opf/openproject/hooks","issue_events_url":"https://api.github.com/repos/opf/openproject/issues/events{/number}","events_url":"https://api.github.com/repos/opf/openproject/events","assignees_url":"https://api.github.com/repos/opf/openproject/assignees{/user}","branches_url":"https://api.github.com/repos/opf/openproject/branches{/branch}","tags_url":"https://api.github.com/repos/opf/openproject/tags","blobs_url":"https://api.github.com/repos/opf/openproject/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/opf/openproject/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/opf/openproject/git/refs{/sha}","trees_url":"https://api.github.com/repos/opf/openproject/git/trees{/sha}","statuses_url":"https://api.github.com/repos/opf/openproject/statuses/{sha}","languages_url":"https://api.github.com/repos/opf/openproject/languages","stargazers_url":"https://api.github.com/repos/opf/openproject/stargazers","contributors_url":"https://api.github.com/repos/opf/openproject/contributors","subscribers_url":"https://api.github.com/repos/opf/openproject/subscribers","subscription_url":"https://api.github.com/repos/opf/openproject/subscription","commits_url":"https://api.github.com/repos/opf/openproject/commits{/sha}","git_commits_url":"https://api.github.com/repos/opf/openproject/git/commits{/sha}","comments_url":"https://api.github.com/repos/opf/openproject/comments{/number}","issue_comment_url":"https://api.github.com/repos/opf/openproject/issues/comments/{number}","contents_url":"https://api.github.com/repos/opf/openproject/contents/{+path}","compare_url":"https://api.github.com/repos/opf/openproject/compare/{base}...{head}","merges_url":"https://api.github.com/repos/opf/openproject/merges","archive_url":"https://api.github.com/repos/opf/openproject/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/opf/openproject/downloads","issues_url":"https://api.github.com/repos/opf/openproject/issues{/number}","pulls_url":"https://api.github.com/repos/opf/openproject/pulls{/number}","milestones_url":"https://api.github.com/repos/opf/openproject/milestones{/number}","notifications_url":"https://api.github.com/repos/opf/openproject/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/opf/openproject/labels{/name}","releases_url":"https://api.github.com/repos/opf/openproject/releases{/id}","created_at":"2012-11-28T09:59:11Z","updated_at":"2015-02-06T12:35:40Z","pushed_at":"2015-02-06T18:28:03Z","git_url":"git://github.com/opf/openproject.git","ssh_url":"git@github.com:opf/openproject.git","clone_url":"https://github.com/opf/openproject.git","svn_url":"https://github.com/opf/openproject","homepage":"https://www.openproject.org","size":164228,"stargazers_count":493,"watchers_count":493,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":221,"mirror_url":null,"open_issues_count":63,"forks":221,"open_issues":63,"watchers":493,"default_branch":"dev"}},"base":{"label":"opf:dev","ref":"dev","sha":"431edeb82850028904678c9524d6d2c4ab6f47eb","user":{"login":"opf","id":1756674,"avatar_url":"https://avatars.githubusercontent.com/u/1756674?v=3","gravatar_id":"","url":"https://api.github.com/users/opf","html_url":"https://github.com/opf","followers_url":"https://api.github.com/users/opf/followers","following_url":"https://api.github.com/users/opf/following{/other_user}","gists_url":"https://api.github.com/users/opf/gists{/gist_id}","starred_url":"https://api.github.com/users/opf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opf/subscriptions","organizations_url":"https://api.github.com/users/opf/orgs","repos_url":"https://api.github.com/users/opf/repos","events_url":"https://api.github.com/users/opf/events{/privacy}","received_events_url":"https://api.github.com/users/opf/received_events","type":"Organization","site_admin":false},"repo":{"id":6899875,"name":"openproject","full_name":"opf/openproject","owner":{"login":"opf","id":1756674,"avatar_url":"https://avatars.githubusercontent.com/u/1756674?v=3","gravatar_id":"","url":"https://api.github.com/users/opf","html_url":"https://github.com/opf","followers_url":"https://api.github.com/users/opf/followers","following_url":"https://api.github.com/users/opf/following{/other_user}","gists_url":"https://api.github.com/users/opf/gists{/gist_id}","starred_url":"https://api.github.com/users/opf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opf/subscriptions","organizations_url":"https://api.github.com/users/opf/orgs","repos_url":"https://api.github.com/users/opf/repos","events_url":"https://api.github.com/users/opf/events{/privacy}","received_events_url":"https://api.github.com/users/opf/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/opf/openproject","description":"OpenProject is a web-based project management system built on Ruby on Rails","fork":false,"url":"https://api.github.com/repos/opf/openproject","forks_url":"https://api.github.com/repos/opf/openproject/forks","keys_url":"https://api.github.com/repos/opf/openproject/keys{/key_id}","collaborators_url":"https://api.github.com/repos/opf/openproject/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/opf/openproject/teams","hooks_url":"https://api.github.com/repos/opf/openproject/hooks","issue_events_url":"https://api.github.com/repos/opf/openproject/issues/events{/number}","events_url":"https://api.github.com/repos/opf/openproject/events","assignees_url":"https://api.github.com/repos/opf/openproject/assignees{/user}","branches_url":"https://api.github.com/repos/opf/openproject/branches{/branch}","tags_url":"https://api.github.com/repos/opf/openproject/tags","blobs_url":"https://api.github.com/repos/opf/openproject/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/opf/openproject/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/opf/openproject/git/refs{/sha}","trees_url":"https://api.github.com/repos/opf/openproject/git/trees{/sha}","statuses_url":"https://api.github.com/repos/opf/openproject/statuses/{sha}","languages_url":"https://api.github.com/repos/opf/openproject/languages","stargazers_url":"https://api.github.com/repos/opf/openproject/stargazers","contributors_url":"https://api.github.com/repos/opf/openproject/contributors","subscribers_url":"https://api.github.com/repos/opf/openproject/subscribers","subscription_url":"https://api.github.com/repos/opf/openproject/subscription","commits_url":"https://api.github.com/repos/opf/openproject/commits{/sha}","git_commits_url":"https://api.github.com/repos/opf/openproject/git/commits{/sha}","comments_url":"https://api.github.com/repos/opf/openproject/comments{/number}","issue_comment_url":"https://api.github.com/repos/opf/openproject/issues/comments/{number}","contents_url":"https://api.github.com/repos/opf/openproject/contents/{+path}","compare_url":"https://api.github.com/repos/opf/openproject/compare/{base}...{head}","merges_url":"https://api.github.com/repos/opf/openproject/merges","archive_url":"https://api.github.com/repos/opf/openproject/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/opf/openproject/downloads","issues_url":"https://api.github.com/repos/opf/openproject/issues{/number}","pulls_url":"https://api.github.com/repos/opf/openproject/pulls{/number}","milestones_url":"https://api.github.com/repos/opf/openproject/milestones{/number}","notifications_url":"https://api.github.com/repos/opf/openproject/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/opf/openproject/labels{/name}","releases_url":"https://api.github.com/repos/opf/openproject/releases{/id}","created_at":"2012-11-28T09:59:11Z","updated_at":"2015-02-06T12:35:40Z","pushed_at":"2015-02-06T18:28:03Z","git_url":"git://github.com/opf/openproject.git","ssh_url":"git@github.com:opf/openproject.git","clone_url":"https://github.com/opf/openproject.git","svn_url":"https://github.com/opf/openproject","homepage":"https://www.openproject.org","size":164228,"stargazers_count":493,"watchers_count":493,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":221,"mirror_url":null,"open_issues_count":63,"forks":221,"open_issues":63,"watchers":493,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/opf/openproject/pulls/2492"},"html":{"href":"https://github.com/opf/openproject/pull/2492"},"issue":{"href":"https://api.github.com/repos/opf/openproject/issues/2492"},"comments":{"href":"https://api.github.com/repos/opf/openproject/issues/2492/comments"},"review_comments":{"href":"https://api.github.com/repos/opf/openproject/pulls/2492/comments"},"review_comment":{"href":"https://api.github.com/repos/opf/openproject/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/opf/openproject/pulls/2492/commits"},"statuses":{"href":"https://api.github.com/repos/opf/openproject/statuses/b2f6d5c58e467c859b79caca258d2fd2a1d77f5d"}}}}