forme 2.2.0 → 2.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +6 -0
- data/README.rdoc +7 -2
- data/lib/forme/bs5.rb +213 -0
- data/lib/forme/version.rb +1 -1
- data/lib/forme.rb +2 -1
- data/lib/roda/plugins/forme_set.rb +5 -3
- data/lib/sequel/plugins/forme_set.rb +2 -0
- metadata +7 -24
- data/Rakefile +0 -82
- data/spec/all.rb +0 -2
- data/spec/bs3_reference_spec.rb +0 -335
- data/spec/bs3_sequel_plugin_spec.rb +0 -523
- data/spec/bs3_spec.rb +0 -751
- data/spec/erb_helper.rb +0 -198
- data/spec/erubi_capture_helper.rb +0 -198
- data/spec/forme_coverage.rb +0 -14
- data/spec/forme_spec.rb +0 -1292
- data/spec/rails_integration_spec.rb +0 -286
- data/spec/roda_integration_spec.rb +0 -541
- data/spec/sequel_helper.rb +0 -103
- data/spec/sequel_i18n_helper.rb +0 -40
- data/spec/sequel_i18n_plugin_spec.rb +0 -31
- data/spec/sequel_plugin_spec.rb +0 -703
- data/spec/sequel_set_plugin_spec.rb +0 -238
- data/spec/shared_erb_specs.rb +0 -71
- data/spec/sinatra_integration_spec.rb +0 -71
- data/spec/spec_helper.rb +0 -31
@@ -1,31 +0,0 @@
|
|
1
|
-
require_relative 'spec_helper'
|
2
|
-
|
3
|
-
begin
|
4
|
-
raise LoadError if defined?(JRUBY_VERSION) && /\A9\.2\./.match(JRUBY_VERSION)
|
5
|
-
require_relative 'sequel_i18n_helper'
|
6
|
-
rescue LoadError
|
7
|
-
warn "unable to load i18n, skipping i18n Sequel plugin spec"
|
8
|
-
else
|
9
|
-
describe "Forme Sequel::Model forms" do
|
10
|
-
before do
|
11
|
-
@ab = Invoice[1]
|
12
|
-
@b = Forme::Form.new(@ab)
|
13
|
-
end
|
14
|
-
|
15
|
-
it "should not change the usual label input if translation is not present" do
|
16
|
-
@b.input(:name).must_equal '<label>Name: <input id="invoice_name" maxlength="255" name="invoice[name]" type="text" value="b"/></label>'
|
17
|
-
end
|
18
|
-
|
19
|
-
it "should use the translation for the label if present" do
|
20
|
-
@b.input(:summary).must_equal '<label>Brief Description: <input id="invoice_summary" maxlength="255" name="invoice[summary]" type="text" value="a brief summary"/></label>'
|
21
|
-
end
|
22
|
-
|
23
|
-
it "should not change the usual legend for the subform if the translation is not present" do
|
24
|
-
Forme.form(Firm[1]){|f| f.subform(:invoices){ f.input(:name) }}.must_equal '<form class="forme firm" method="post"><input id="firm_invoices_attributes_0_id" name="firm[invoices_attributes][0][id]" type="hidden" value="1"/><fieldset class="inputs"><legend>Invoice #1</legend><label>Name: <input id="firm_invoices_attributes_0_name" maxlength="255" name="firm[invoices_attributes][0][name]" type="text" value="b"/></label></fieldset></form>'
|
25
|
-
end
|
26
|
-
|
27
|
-
it "should use the translation for the legend on the subform if present" do
|
28
|
-
Forme.form(Firm[1]){|f| f.subform(:clients){ f.input(:name) }}.must_equal '<form class="forme firm" method="post"><input id="firm_clients_attributes_0_id" name="firm[clients_attributes][0][id]" type="hidden" value="1"/><fieldset class="inputs"><legend>Clientes</legend><label>Name: <input id="firm_clients_attributes_0_name" maxlength="255" name="firm[clients_attributes][0][name]" type="text" value="a great client"/></label></fieldset></form>'
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|