egalite 1.2.1 → 1.2.2

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.
@@ -264,7 +264,7 @@ class CSRFTemplate < HTMLTemplate
264
264
  csrf = nil
265
265
  if attrs[":nocsrf"]
266
266
  attrs.delete(":nocsrf")
267
- elsif attrs["method"].upcase == "POST"
267
+ elsif attrs["method"] =~ /\APOST\Z/i
268
268
  csrf = params["csrf"]
269
269
  csrf = "<input type='hidden' name='csrf' value='#{escapeHTML(csrf)}'/>"
270
270
  end
@@ -1,3 +1,3 @@
1
1
  module Egalite
2
- VERSION = "1.2.1"
2
+ VERSION = "1.2.2"
3
3
  end
data/test/test_helper.rb CHANGED
@@ -239,16 +239,20 @@ class T_FormHelper < Test::Unit::TestCase
239
239
 
240
240
  def test_select_by_array_array
241
241
  f = FormHelper.new()
242
- array = [[1,:foo],[2,:bar]]
242
+ array = [[nil,nil],[1,:foo],[2,:bar]]
243
243
  d = to_doc(f.select_by_array("test", array))
244
244
  assert_equal(1, X(d, "/select").size)
245
- assert_equal(2, X(d, "/select/option").size)
245
+ assert_equal("test", X(d, "/select")[0].attributes["name"])
246
+ assert_equal(3, X(d, "/select/option").size)
246
247
  o0 = X(d, "/select/option")[0]
247
- assert_equal("foo", o0.text)
248
- assert_equal("1", o0.attributes["value"])
248
+ assert_equal(nil, o0.text)
249
+ assert_equal("", o0.attributes["value"])
249
250
  o1 = X(d, "/select/option")[1]
250
- assert_equal("bar", o1.text)
251
- assert_equal("2", o1.attributes["value"])
251
+ assert_equal("foo", o1.text)
252
+ assert_equal("1", o1.attributes["value"])
253
+ o2 = X(d, "/select/option")[2]
254
+ assert_equal("bar", o2.text)
255
+ assert_equal("2", o2.attributes["value"])
252
256
  end
253
257
 
254
258
  def test_select_by_array_string
@@ -256,6 +260,7 @@ class T_FormHelper < Test::Unit::TestCase
256
260
  array = [:foo,:bar]
257
261
  d = to_doc(f.select_by_array("test", array))
258
262
  assert_equal(1, X(d, "/select").size)
263
+ assert_equal("test", X(d, "/select")[0].attributes["name"])
259
264
  assert_equal(2, X(d, "/select/option").size)
260
265
  o0 = X(d, "/select/option")[0]
261
266
  assert_equal("foo", o0.text)
@@ -319,6 +324,3 @@ class T_FormHelper < Test::Unit::TestCase
319
324
  end
320
325
 
321
326
  end
322
-
323
- # XXX: test form
324
- # XXX: test expand_name
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: egalite
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 2
9
- - 1
10
- version: 1.2.1
9
+ - 2
10
+ version: 1.2.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Shunichi Arai