twilson63-sinatra-formhelpers 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 2
4
- :patch: 0
4
+ :patch: 1
@@ -39,8 +39,8 @@ module Sinatra
39
39
  single_tag :img, options.merge(:src => src)
40
40
  end
41
41
 
42
- def submit(obj, value, options={})
43
- single_tag :input, options.merge(:type => "submit", :value => value)
42
+ def submit(obj, value="", options={})
43
+ single_tag :input, options.merge(:type => "submit", :value => value == "" ? obj : value)
44
44
  end
45
45
 
46
46
  def checkbox(obj, field, options={})
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{sinatra-formhelpers}
5
- s.version = "0.2.0"
5
+ s.version = "0.2.1"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["twilson63"]
@@ -156,7 +156,22 @@ class FormHelpersTest < Test::Unit::TestCase
156
156
  end
157
157
  end
158
158
 
159
-
159
+ describe 'formhelpers submit single arg' do
160
+ setup do
161
+ mock_app {
162
+ helpers Sinatra::FormHelpers
163
+ get '/' do
164
+ haml "= submit 'Create'"
165
+ end
166
+ }
167
+ end
168
+
169
+ it 'renders an input tag with a submit type with single arg' do
170
+ get '/'
171
+ assert_equal "<input value='Create' type='submit' />\n", body
172
+ end
173
+ end
174
+
160
175
  describe 'formhelpers checkbox' do
161
176
  setup do
162
177
  mock_app {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twilson63-sinatra-formhelpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - twilson63