Sha256: 96b58de5b193e69f5a9f4e8b94aee3f834be369f7e4720a26f7cc7268a516ca5

Contents?: true

Size: 759 Bytes

Versions: 2

Compression:

Stored size: 759 Bytes

Contents

require 'test_helper'

class NivoSliderHelperTest < Minitest::Test
  attr_accessor :output_buffer

  include ActionView::Helpers::TagHelper
  include NivoHelper

  def test_with_content_tag_options
    assert_match 'class="foo', nivo_slider(class: "foo")
    assert_match 'id="bar"', nivo_slider(id: "bar")
  end

  def test_automatically_includes_nivoSlider_class
    assert_match 'class="nivoSlider"', nivo_slider
  end

  def test_automatically_includes_slider_id
    assert_match 'id="slider"', nivo_slider
  end

  def test_with_a_block
    assert_match 'foo', nivo_slider { "foo" }
  end

  def test_with_options_and_block
    expected = '<div id="foo" class="nivoSlider">Bar</div>'
    assert_equal expected, nivo_slider(id: "foo") { "Bar" }
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
nivo-rails-1.0.1 test/nivo_slider_helper_test.rb
nivo-rails-1.0.0 test/nivo_slider_helper_test.rb