Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test for false value #1

Merged
merged 1 commit into from Feb 7, 2012
Merged

Add test for false value #1

merged 1 commit into from Feb 7, 2012

Conversation

ghost
Copy link

@ghost ghost commented Feb 6, 2012

Addition of a test for false value and small modification of test for nil value

  test "nil value" do
    json = Jbuilder.encode do |json|
      json.content nil
    end

    JSON.parse(json).tap do |parsed|
      assert parsed.has_key?("content")
      assert_equal nil, parsed["content"]
    end
  end

  test "false value" do
    json = Jbuilder.encode do |json|
      json.published false
    end

    assert_equal false, JSON.parse(json)["published"]
  end

joshmcarthur added a commit that referenced this pull request Feb 7, 2012
Add test for false value
@joshmcarthur joshmcarthur merged commit e08e49a into 3months:master Feb 7, 2012
@joshmcarthur
Copy link

Thanks for improving our tests @delba!
I've merged this into master, so it should be lodged against the pull request I've opened against the main repository to fix the issue at rails#15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants