Sha256: 545defaf4e1eb4a4e21bebb358e404e74d3021dde03e5a59bb072e10a110b5ac

Contents?: true

Size: 1.07 KB

Versions: 6

Compression:

Stored size: 1.07 KB

Contents

require "test_helper"

class TestChartkick < Minitest::Test
  include Chartkick::Helper

  # TODO actual tests

  def setup
    @data = [[34, 42], [56, 49]]
  end

  def test_line_chart
    assert line_chart(@data)
  end

  def test_pie_chart
    assert pie_chart(@data)
  end

  def test_column_chart
    assert column_chart(@data)
  end

  def test_options_not_mutated
    options = {id: "boom"}
    line_chart @data, options
    assert_equal "boom", options[:id]
  end

  def test_chartkick_deep_merge_different_inner_key
    global_option = {library: {backgroundColor: "#eee"}}
    local_option = {library: {title: "test"}}
    correct_merge = {library: {backgroundColor: "#eee", title: "test"}}
    assert_equal chartkick_deep_merge(global_option, local_option), correct_merge
  end

  def test_chartkick_deep_merge_same_inner_key
    global_option = {library: {backgroundColor: "#eee"}}
    local_option = {library: {backgroundColor: "#fff"}}
    correct_merge = {library: {backgroundColor: "#fff"}}
    assert_equal chartkick_deep_merge(global_option, local_option), correct_merge
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
chartkick-2.3.5 test/chartkick_test.rb
chartkick-2.3.4 test/chartkick_test.rb
chartkick-2.3.3 test/chartkick_test.rb
chartkick-2.3.2 test/chartkick_test.rb
chartkick-2.3.1 test/chartkick_test.rb
chartkick-2.3.0 test/chartkick_test.rb