]> source.dussan.org Git - redmine.git/commitdiff
Merged r13216, r13217 (#17003).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 6 Jul 2014 10:29:22 +0000 (10:29 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 6 Jul 2014 10:29:22 +0000 (10:29 +0000)
git-svn-id: http://svn.redmine.org/redmine/branches/2.5-stable@13222 e93f8b46-1217-0410-a6f0-8f06a7374b81

52 files changed:
app/helpers/custom_fields_helper.rb
app/views/custom_fields/formats/_bool.html.erb
config/locales/ar.yml
config/locales/az.yml
config/locales/bg.yml
config/locales/bs.yml
config/locales/ca.yml
config/locales/cs.yml
config/locales/da.yml
config/locales/de.yml
config/locales/el.yml
config/locales/en-GB.yml
config/locales/en.yml
config/locales/es.yml
config/locales/et.yml
config/locales/eu.yml
config/locales/fa.yml
config/locales/fi.yml
config/locales/fr.yml
config/locales/gl.yml
config/locales/he.yml
config/locales/hr.yml
config/locales/hu.yml
config/locales/id.yml
config/locales/it.yml
config/locales/ja.yml
config/locales/ko.yml
config/locales/lt.yml
config/locales/lv.yml
config/locales/mk.yml
config/locales/mn.yml
config/locales/nl.yml
config/locales/no.yml
config/locales/pl.yml
config/locales/pt-BR.yml
config/locales/pt.yml
config/locales/ro.yml
config/locales/ru.yml
config/locales/sk.yml
config/locales/sl.yml
config/locales/sq.yml
config/locales/sr-YU.yml
config/locales/sr.yml
config/locales/sv.yml
config/locales/th.yml
config/locales/tr.yml
config/locales/uk.yml
config/locales/vi.yml
config/locales/zh-TW.yml
config/locales/zh.yml
lib/redmine/field_format.rb
test/unit/lib/redmine/field_format/bool_format_test.rb [new file with mode: 0644]

index 173e0d5f81ac6317e0b884078b159af99c409342..5153c1489d75a4c5aaf63d01e8b07b7242a9583e 100644 (file)
@@ -138,7 +138,11 @@ module CustomFieldsHelper
     end unless custom_values.empty?
   end
 
-  def edit_tag_style_tag(form)
-    form.select :edit_tag_style, [[l(:label_drop_down_list), ''], [l(:label_checkboxes), 'check_box']], :label => :label_display
+  def edit_tag_style_tag(form, options={})
+    select_options = [[l(:label_drop_down_list), ''], [l(:label_checkboxes), 'check_box']]
+    if options[:include_radio]
+      select_options << [l(:label_radio_buttons), 'radio']
+    end
+    form.select :edit_tag_style, select_options, :label => :label_display
   end
 end
index 81aa64afee2f905801d3bd152cbb0f0d6208f8d3..3b791acfe6aa73a45095b414b8d7465c2ac832a6 100644 (file)
@@ -1,3 +1,3 @@
 <p><%= f.select :default_value, [[]]+@custom_field.possible_values_options %></p>
 <p><%= f.text_field :url_pattern, :size => 50, :label => :label_link_values_to %></p>
-<p><%= edit_tag_style_tag f %></p>
+<p><%= edit_tag_style_tag f, :include_radio => true %></p>
index e83e70b291f5e86df96797f8c6669345fd6c89e4..04668d0e7539d1ba978d5d9a77c25054a0a9e9fb 100644 (file)
@@ -1115,3 +1115,4 @@ ar:
   label_check_for_updates: Check for updates
   label_latest_compatible_version: Latest compatible version
   label_unknown_plugin: Unknown plugin
+  label_radio_buttons: radio buttons
index 970bd0ac9a9da3617c9e7b674620302242fe79f0..c4881f0e60b9b09378414148087c9702e74d7929 100644 (file)
@@ -1212,3 +1212,4 @@ az:
   label_check_for_updates: Check for updates
   label_latest_compatible_version: Latest compatible version
   label_unknown_plugin: Unknown plugin
+  label_radio_buttons: radio buttons
index 618eeb04dc158b55d7642bc527933a64b592c531..9400e23f1c7ffefa59a79fc2be56b86d268f7269 100644 (file)
@@ -1109,3 +1109,4 @@ bg:
   description_date_from: Въведете начална дата
   description_date_to: Въведете крайна дата
   text_repository_identifier_info: 'Позволени са малки букви (a-z), цифри, тирета и _.<br />Промяна след създаването му не е възможна.'
+  label_radio_buttons: radio buttons
index 95214930308007731d92f2dcd11b5f94e4bf7888..80b7b5ee83747d5bb67360130ae161edb55f7c9b 100644 (file)
@@ -1128,3 +1128,4 @@ bs:
   label_check_for_updates: Check for updates
   label_latest_compatible_version: Latest compatible version
   label_unknown_plugin: Unknown plugin
+  label_radio_buttons: radio buttons
index 6f1c3e3f221c3fcd359e6160f7d1120b03ddf9cd..2f9b512f52470e13ebdacb3dddbd5f95472f1dbd 100644 (file)
@@ -1117,3 +1117,4 @@ ca:
   label_check_for_updates: Check for updates
   label_latest_compatible_version: Latest compatible version
   label_unknown_plugin: Unknown plugin
+  label_radio_buttons: radio buttons
index 6db8280c8e27d153817f72b13edea72daabc58ba..2e902c3646629ee27b8e647e88eab45052c270d7 100644 (file)
@@ -1117,3 +1117,4 @@ cs:
   label_check_for_updates: Zkontroluj aktualizace
   label_latest_compatible_version: Poslední kompatibilní verze
   label_unknown_plugin: Nezámý plugin
+  label_radio_buttons: radio buttons
index a5b19cf278e6121aa851f6d301144afc1a5e0e7d..02d10f0bf33dccda5a568e8e3c69330436ee1603 100644 (file)
@@ -1132,3 +1132,4 @@ da:
   label_check_for_updates: Check for updates
   label_latest_compatible_version: Latest compatible version
   label_unknown_plugin: Unknown plugin
+  label_radio_buttons: radio buttons
index 58bb692c390ab267de80e0cd6a71fb3321d122af..d63d78abd274415c7fb9a9024715c460cc048235 100644 (file)
@@ -1124,3 +1124,4 @@ de:
   version_status_open: offen
 
   warning_attachments_not_saved: "%{count} Datei(en) konnten nicht gespeichert werden."
+  label_radio_buttons: radio buttons
index a570921605e6103287f990e88aab094b17cb5350..785eb8d28486753373e21c2fda1869f3291b3910 100644 (file)
@@ -1115,3 +1115,4 @@ el:
   label_check_for_updates: Check for updates
   label_latest_compatible_version: Latest compatible version
   label_unknown_plugin: Unknown plugin
+  label_radio_buttons: radio buttons
index 04ecfe1b122ad73d6230e888cd7b538486e07e4f..a257d9acc0cb95214f15b79fb4edb4e44e1b7867 100644 (file)
@@ -1117,3 +1117,4 @@ en-GB:
   label_check_for_updates: Check for updates
   label_latest_compatible_version: Latest compatible version
   label_unknown_plugin: Unknown plugin
+  label_radio_buttons: radio buttons
index fc5072cf6c81ef9405d09b54db2875733f954f37..e28b8e729786a249bd4d5ebb2ee3c94f60fd04af 100644 (file)
@@ -909,6 +909,7 @@ en:
   label_only: only
   label_drop_down_list: drop-down list
   label_checkboxes: checkboxes
+  label_radio_buttons: radio buttons
   label_link_values_to: Link values to URL
   label_custom_field_select_type: Select the type of object to which the custom field is to be attached
   label_check_for_updates: Check for updates
index 0b41e49a4c9be9f9c0bf1e9815a0dc573ec6585a..804f61e56be54940470ac9f181cac758a6eda1ec 100644 (file)
@@ -1148,3 +1148,4 @@ es:
   label_check_for_updates: Check for updates
   label_latest_compatible_version: Latest compatible version
   label_unknown_plugin: Unknown plugin
+  label_radio_buttons: radio buttons
index 12e963e0af3f0f32375812760138290545ab0e81..56ecd78b62690043666ccc7ec43262fedb3066cb 100644 (file)
@@ -1128,3 +1128,4 @@ et:
   label_check_for_updates: Check for updates
   label_latest_compatible_version: Latest compatible version
   label_unknown_plugin: Unknown plugin
+  label_radio_buttons: radio buttons
index c36091f42ccbbf4a27e1d898c6cf49e1426e3eb5..930081461599239ce2e377103facb32a6f3a78ed 100644 (file)
@@ -1116,3 +1116,4 @@ eu:
   label_check_for_updates: Check for updates
   label_latest_compatible_version: Latest compatible version
   label_unknown_plugin: Unknown plugin
+  label_radio_buttons: radio buttons
index 687d77b4cce6a7fb55671435158bd0f669d5df9c..faff21fca25b9c725180d6b28737b0ca3c3cdb42 100644 (file)
@@ -1117,3 +1117,4 @@ fa:
   label_check_for_updates: Check for updates
   label_latest_compatible_version: Latest compatible version
   label_unknown_plugin: Unknown plugin
+  label_radio_buttons: radio buttons
index 35e7977eb7659e609d529c77e7fd5df01f889c7c..b31ae68f50d0a7a869748a4495bfba2a5ce3060e 100644 (file)
@@ -1136,3 +1136,4 @@ fi:
   label_check_for_updates: Check for updates
   label_latest_compatible_version: Latest compatible version
   label_unknown_plugin: Unknown plugin
+  label_radio_buttons: radio buttons
index 57bbd491fe3dae7b99653ae045957a9a3ead526f..c9213adaa44ed5f75b3e8d7a61f232978da85801 100644 (file)
@@ -885,6 +885,7 @@ fr:
   label_only: seulement
   label_drop_down_list: liste déroulante
   label_checkboxes: cases à cocher
+  label_radio_buttons: boutons radio
   label_link_values_to: Lier les valeurs vers l'URL
   label_custom_field_select_type: Selectionner le type d'objet auquel attacher le champ personnalisé
   label_check_for_updates: Vérifier les mises à jour
index 89ff4263122f678e952872bb8f9b3778bb456949..e3859dfee6585edd58c2440dbc9fc46c1755ffe0 100644 (file)
@@ -1126,3 +1126,4 @@ gl:
   label_check_for_updates: Check for updates
   label_latest_compatible_version: Latest compatible version
   label_unknown_plugin: Unknown plugin
+  label_radio_buttons: radio buttons
index eda59b18e049dbdc3a6b45cc27d19e7f4886f26b..843354d3cee52db218d3dee31e354711564d6b1b 100644 (file)
@@ -1120,3 +1120,4 @@ he:
   label_check_for_updates: Check for updates
   label_latest_compatible_version: Latest compatible version
   label_unknown_plugin: Unknown plugin
+  label_radio_buttons: radio buttons
index 2483f3b403d7503001e8909971a225870966f134..a21fe8cd84bc3d1ab5d66b874711c91afaffc8c2 100644 (file)
@@ -1116,3 +1116,4 @@ hr:
   label_check_for_updates: Check for updates
   label_latest_compatible_version: Latest compatible version
   label_unknown_plugin: Unknown plugin
+  label_radio_buttons: radio buttons
index fdf42e286e8a857cec219c9024d5db298a9ec3c1..4768c7939a4dc17213a514f026caac75d780cdcd 100644 (file)
   label_check_for_updates: Check for updates
   label_latest_compatible_version: Latest compatible version
   label_unknown_plugin: Unknown plugin
+  label_radio_buttons: radio buttons
index a46064be814c59610f2d23bffcd4e6e53bf16358..eee676d5dcf8075981347808d91e118ac9b5a7c6 100644 (file)
@@ -1119,3 +1119,4 @@ id:
   label_check_for_updates: Check for updates
   label_latest_compatible_version: Latest compatible version
   label_unknown_plugin: Unknown plugin
+  label_radio_buttons: radio buttons
index e7a9eb0ea171f38621a871a89cd9b62497f0e320..92efb5c6be58ce4ed9fa26d526ba2b620859b189 100644 (file)
@@ -1114,3 +1114,4 @@ it:
   label_check_for_updates: Check for updates
   label_latest_compatible_version: Latest compatible version
   label_unknown_plugin: Unknown plugin
+  label_radio_buttons: radio buttons
index e896873aadcf340055a26527c30dbc0ceeadd457..fef14ef3053ebfeabb6f79171f6f742e42b876b0 100644 (file)
@@ -1139,3 +1139,4 @@ ja:
   label_check_for_updates: アップデートを確認
   label_latest_compatible_version: 互換性のある最新バージョン
   label_unknown_plugin: 不明なプラグイン
+  label_radio_buttons: radio buttons
index 53c84f701d1e7dfd5c4c46ffc349ec07ab77e32f..03129ac0286a3a001cee16e2cce1c92f1ec0d886 100644 (file)
@@ -1159,3 +1159,4 @@ ko:
   label_check_for_updates: Check for updates
   label_latest_compatible_version: Latest compatible version
   label_unknown_plugin: Unknown plugin
+  label_radio_buttons: radio buttons
index ad731b49f7762104b3fd1fb1c9e171f4472a8c75..da6af8a186b98052714578281e2735a70dd1d0a0 100644 (file)
@@ -1174,3 +1174,4 @@ lt:
   label_check_for_updates: Check for updates
   label_latest_compatible_version: Latest compatible version
   label_unknown_plugin: Unknown plugin
+  label_radio_buttons: radio buttons
index cf00b755cc93c50bc124a68d91316185e52a0645..328325a98d629353a5498f39a1c53a81e4a68921 100644 (file)
@@ -1109,3 +1109,4 @@ lv:
   label_check_for_updates: Check for updates
   label_latest_compatible_version: Latest compatible version
   label_unknown_plugin: Unknown plugin
+  label_radio_buttons: radio buttons
index 9a517be1129f0bb4a7fb3996238eb4d05ce17d8f..f45858dcc3d543057e9b87b35bc73994c69da9b0 100644 (file)
@@ -1115,3 +1115,4 @@ mk:
   label_check_for_updates: Check for updates
   label_latest_compatible_version: Latest compatible version
   label_unknown_plugin: Unknown plugin
+  label_radio_buttons: radio buttons
index 35a11c224b7babc2823b715323565c929fb27336..4ea477f68ca820e4cb49cc80f748e2d02ead6386 100644 (file)
@@ -1116,3 +1116,4 @@ mn:
   label_check_for_updates: Check for updates
   label_latest_compatible_version: Latest compatible version
   label_unknown_plugin: Unknown plugin
+  label_radio_buttons: radio buttons
index 83181133ebfd092f06bdbc2d42a2e158c12ea3ee..c07fa305fb837aab9b5a1cb57578236dc02c8e8b 100644 (file)
@@ -1094,3 +1094,4 @@ nl:
   label_check_for_updates: Check for updates
   label_latest_compatible_version: Latest compatible version
   label_unknown_plugin: Unknown plugin
+  label_radio_buttons: radio buttons
index c1353017434b89450d7018bc5dde633410a9b5d6..7839729079f2b12b7b536f02962efddb29f48c1d 100644 (file)
   label_check_for_updates: Check for updates
   label_latest_compatible_version: Latest compatible version
   label_unknown_plugin: Unknown plugin
+  label_radio_buttons: radio buttons
index f38cb43e5b7e6b33dbf4bef3acba0ba28f24803f..4b623ee34b113e8e3c99241cf156201e6f8c5061 100644 (file)
@@ -1135,3 +1135,4 @@ pl:
   label_check_for_updates: Check for updates
   label_latest_compatible_version: Latest compatible version
   label_unknown_plugin: Unknown plugin
+  label_radio_buttons: radio buttons
index cbb9deb9aa0f1101e5c5b7b7ff8029835e4f5a2c..10d0407e12b2802dc64098ecaeb1493b7648a88b 100644 (file)
@@ -1134,3 +1134,4 @@ pt-BR:
   label_check_for_updates: Check for updates
   label_latest_compatible_version: Latest compatible version
   label_unknown_plugin: Unknown plugin
+  label_radio_buttons: radio buttons
index 88aec01b4108350e4bdc613fa4592877b76a9a8e..9141227278540c3690b55916f7faeb1318326f5e 100644 (file)
@@ -1121,3 +1121,4 @@ pt:
   label_check_for_updates: Check for updates
   label_latest_compatible_version: Latest compatible version
   label_unknown_plugin: Unknown plugin
+  label_radio_buttons: radio buttons
index 09f11b18977e13d3ed3892dc456ded2ac0846cdf..e46759e8ca74dbdbf29f54dfa7301ad15e5354e7 100644 (file)
@@ -1110,3 +1110,4 @@ ro:
   label_check_for_updates: Check for updates
   label_latest_compatible_version: Latest compatible version
   label_unknown_plugin: Unknown plugin
+  label_radio_buttons: radio buttons
index d49608079748126a35277742a7200eb964f86f81..734f7beb46288fe65385c6fb612ad6450f33f13d 100644 (file)
@@ -1221,3 +1221,4 @@ ru:
   label_check_for_updates: Check for updates
   label_latest_compatible_version: Latest compatible version
   label_unknown_plugin: Unknown plugin
+  label_radio_buttons: radio buttons
index 509209d4551e917e9494f34e5ca3fe3d590b2b3d..4210e17c9b93180d6cdfd3cf892d99f26f123121 100644 (file)
@@ -1105,3 +1105,4 @@ sk:
   label_check_for_updates: Check for updates
   label_latest_compatible_version: Latest compatible version
   label_unknown_plugin: Unknown plugin
+  label_radio_buttons: radio buttons
index 18d4a44d29e84a3476c0455199dbb9c0a5754825..148f1c87c4778cf84e076730adcb45fcc3411ce1 100644 (file)
@@ -1115,3 +1115,4 @@ sl:
   label_check_for_updates: Check for updates
   label_latest_compatible_version: Latest compatible version
   label_unknown_plugin: Unknown plugin
+  label_radio_buttons: radio buttons
index 132867018880a8d7f4bbc45b9565e03442298875..bf196218d75863f28bfa66259c26fbbb1991d296 100644 (file)
@@ -1111,3 +1111,4 @@ sq:
   label_check_for_updates: Check for updates
   label_latest_compatible_version: Latest compatible version
   label_unknown_plugin: Unknown plugin
+  label_radio_buttons: radio buttons
index d7d6a05a568701904ed4c050fd565a91af8052aa..959aebdceb5600f3ea4b700c5b6d24a74e1d0eca 100644 (file)
@@ -1117,3 +1117,4 @@ sr-YU:
   label_check_for_updates: Check for updates
   label_latest_compatible_version: Latest compatible version
   label_unknown_plugin: Unknown plugin
+  label_radio_buttons: radio buttons
index fc743137e2fda86482e16f71f8c72499b492a3c4..d19063744641e3a915a92c4c3b5508d423e2d08f 100644 (file)
@@ -1116,3 +1116,4 @@ sr:
   label_check_for_updates: Check for updates
   label_latest_compatible_version: Latest compatible version
   label_unknown_plugin: Unknown plugin
+  label_radio_buttons: radio buttons
index 9f2dae972655de7ec548a6f03755c5bc8bae76a0..b0144a70c80ed0f9544b7b62e452762164e0b2a2 100644 (file)
@@ -1153,3 +1153,4 @@ sv:
   label_check_for_updates: Check for updates
   label_latest_compatible_version: Latest compatible version
   label_unknown_plugin: Unknown plugin
+  label_radio_buttons: radio buttons
index ef77747aa49368ea2f989aa6f0897e5b81572a27..40f5e225f2e8b398892becf0ef8975864b45307b 100644 (file)
@@ -1112,3 +1112,4 @@ th:
   label_check_for_updates: Check for updates
   label_latest_compatible_version: Latest compatible version
   label_unknown_plugin: Unknown plugin
+  label_radio_buttons: radio buttons
index a2748b57b9915ba07c6514065b55ec44c4ed8668..879815ce51abe2266d45f05bffa6f7919f9cc676 100644 (file)
@@ -1124,3 +1124,4 @@ tr:
   label_check_for_updates: Check for updates
   label_latest_compatible_version: Latest compatible version
   label_unknown_plugin: Unknown plugin
+  label_radio_buttons: radio buttons
index 70c6ff14aef7a424b8d84547968c5b346ed16775..75c6bc60923d60fc94d82b3e6128632b6fde6812 100644 (file)
@@ -1110,3 +1110,4 @@ uk:
   label_check_for_updates: Check for updates
   label_latest_compatible_version: Latest compatible version
   label_unknown_plugin: Unknown plugin
+  label_radio_buttons: radio buttons
index c6e5b3402bfd11c9ba755c41e2289d02390a4bc9..15e9dffb800ba2a7bfa6f724bb55bb7511f85e73 100644 (file)
@@ -1168,3 +1168,4 @@ vi:
   label_check_for_updates: Check for updates
   label_latest_compatible_version: Latest compatible version
   label_unknown_plugin: Unknown plugin
+  label_radio_buttons: radio buttons
index 9b38f474da9b9e4a1a77200e75b194de31e9a6d8..b229e0c9974bcb0400b10c95246e1bc806e53dc4 100644 (file)
   description_date_from: 輸入起始日期
   description_date_to: 輸入結束日期
   text_repository_identifier_info: '僅允許使用小寫英文字母 (a-z), 阿拉伯數字, 虛線與底線。<br />一旦儲存之後, 代碼便無法再次被更改。'
+  label_radio_buttons: radio buttons
index b8ec9548ff9574f0131974e554675ae79b73abe6..d01f0111f132e2a8b0b9cd852c2ef91106a77706 100644 (file)
@@ -1116,3 +1116,4 @@ zh:
   label_check_for_updates: Check for updates
   label_latest_compatible_version: Latest compatible version
   label_unknown_plugin: Unknown plugin
+  label_radio_buttons: radio buttons
index f5e6426287c1b1353c5601c7188219578354561b..b71a79f9b3871249e51cd9963a3cd44fdc6bf226 100644 (file)
@@ -566,6 +566,25 @@ module Redmine
       def group_statement(custom_field)
         order_statement(custom_field)
       end
+
+      def edit_tag(view, tag_id, tag_name, custom_value, options={})
+        case custom_value.custom_field.edit_tag_style
+        when 'check_box'
+          single_check_box_edit_tag(view, tag_id, tag_name, custom_value, options)
+        when 'radio'
+          check_box_edit_tag(view, tag_id, tag_name, custom_value, options)
+        else
+          select_edit_tag(view, tag_id, tag_name, custom_value, options)
+        end
+      end
+
+      # Renders the edit tag as a simple check box
+      def single_check_box_edit_tag(view, tag_id, tag_name, custom_value, options={})
+        s = ''.html_safe
+        s << view.hidden_field_tag(tag_name, '0', :id => nil)
+        s << view.check_box_tag(tag_name, '1', custom_value.value.to_s == '1', :id => tag_id)
+        view.content_tag('span', s, options)
+      end
     end
 
     class RecordList < List
diff --git a/test/unit/lib/redmine/field_format/bool_format_test.rb b/test/unit/lib/redmine/field_format/bool_format_test.rb
new file mode 100644 (file)
index 0000000..e5373a5
--- /dev/null
@@ -0,0 +1,63 @@
+# Redmine - project management software
+# Copyright (C) 2006-2014  Jean-Philippe Lang
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+
+require File.expand_path('../../../../../test_helper', __FILE__)
+require 'redmine/field_format'
+
+class Redmine::BoolFieldFormatTest < ActionView::TestCase
+  include ApplicationHelper
+  include Redmine::I18n
+
+  def setup
+    set_language_if_valid 'en'
+  end
+
+  def test_check_box_style_should_render_edit_tag_as_check_box
+    field = IssueCustomField.new(:field_format => 'bool', :is_required => false, :edit_tag_style => 'check_box')
+    value = CustomFieldValue.new(:custom_field => field, :customized => Issue.new)
+
+    tag = field.format.edit_tag(self, 'abc', 'xyz', value)
+    assert_select_in tag, 'input[name=xyz]', 2
+    assert_select_in tag, 'input[id=abc]', 1
+    assert_select_in tag, 'input[type=hidden][value=0]'
+    assert_select_in tag, 'input[type=checkbox][value=1]'
+  end
+
+  def test_check_box_should_be_checked_when_value_is_set
+    field = IssueCustomField.new(:field_format => 'bool', :is_required => false, :edit_tag_style => 'check_box')
+    value = CustomFieldValue.new(:custom_field => field, :customized => Issue.new, :value => '1')
+
+    tag = field.format.edit_tag(self, 'abc', 'xyz', value)
+    assert_select_in tag, 'input[type=checkbox][value=1][checked=checked]'
+  end
+
+  def test_radio_style_should_render_edit_tag_as_radio_buttons
+    field = IssueCustomField.new(:field_format => 'bool', :is_required => false, :edit_tag_style => 'radio')
+    value = CustomFieldValue.new(:custom_field => field, :customized => Issue.new)
+
+    tag = field.format.edit_tag(self, 'abc', 'xyz', value)
+    assert_select_in tag, 'input[type=radio][name=xyz]', 3
+  end
+
+  def test_default_style_should_render_edit_tag_as_select
+    field = IssueCustomField.new(:field_format => 'bool', :is_required => false)
+    value = CustomFieldValue.new(:custom_field => field, :customized => Issue.new)
+
+    tag = field.format.edit_tag(self, 'abc', 'xyz', value)
+    assert_select_in tag, 'select[name=xyz]', 1
+  end
+end