Sha256: 61dc77f0af8f4e2f6ae5c7b818fd762b92d78b5fb5f65444911462603d79ff3b

Contents?: true

Size: 660 Bytes

Versions: 2

Compression:

Stored size: 660 Bytes

Contents

require_relative 'test_helper'

describe Nav do

  before do
    @view = ActionView::Base.new
    @view.output_buffer = ''

    stub( @view ).current_page? { false }
  end

  it "should display ul" do
    m = @view.nav(:id => 'my-nav') { |m| m.action('my-link', '/link') }
    assert_match(/<ul.*id=\"my-nav\">.*<\/ul>/, m)
  end

  it "should display li" do
    m = @view.nav { |m| m.action('my-link', '/link') }
    assert_match(/<li.*>.*<\/li>/, m)
  end

  it "should display link" do
    m = @view.nav { |m| m.action('my-link', '/link') }
    assert_match(/<a.*href=\"\/link\">my-link<\/a>/, m)
  end

  # TODO: Add test cases for actions with blocks
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
nav-0.9.0 test/nav_test.rb
nav-0.7.0 test/nav_test.rb