Sha256: e944c456e9a4850e7302852de8c3203dbe18d236a07c7547b4e82c62c2198331

Contents?: true

Size: 565 Bytes

Versions: 2

Compression:

Stored size: 565 Bytes

Contents

require "test_helper"

class ActiveSupport::TestCase
  setup do
    @routes = MenuBuilder::Routes
  end
end

class BooksController < ApplicationController
  menu_item :home

  def index
  end
  
  def show
    menu_item :show
  end
end

class MenuBuilderTest < ActionController::TestCase
  tests BooksController

  test "should assigns the current tab in class level" do
    get :index
    assert_equal(:home, assigns(:menu_item))
  end

  test "should assigns the current tab in action level" do
    get :show
    assert_equal(:show, assigns(:menu_item))
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
menu_builder-0.3.3 test/controller_test.rb
menu_builder-0.3.2 test/controller_test.rb