Project

General

Profile

Defect #20788 ยป 20788-missing-jsonvalue-false.patch

Yuichi HARADA, 2018-11-21 03:30

View differences:

lib/redmine/views/builders/structure.rb
end
def method_missing(sym, *args, &block)
if args.any?
if args.count > 0
if args.first.is_a?(Hash)
if @struct.last.is_a?(Array)
@struct.last << args.first unless block
test/unit/lib/redmine/views/builders/json_test.rb
require File.expand_path('../../../../../../test_helper', __FILE__)
class Redmine::Views::Builders::JsonTest < ActiveSupport::TestCase
def test_nil_and_false
assert_json_output({'value' => nil}) do |b|
b.value nil
end
assert_json_output({'value' => false}) do |b|
b.value false
end
end
def test_hash
assert_json_output({'person' => {'name' => 'Ryan', 'age' => 32}}) do |b|
    (1-1/1)