Skip to content

Commit

Permalink
do more testing
Browse files Browse the repository at this point in the history
  • Loading branch information
ruurd committed Jul 24, 2012
1 parent 504579b commit 5a33b5f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/unit/tabs/tabs_builder_test.rb
Expand Up @@ -4,6 +4,7 @@ class TabsBuilderTest < ActionView::TestCase

def setup
@builder = TabsOnRails::Tabs::TabsBuilder.new(self)
@bootbldr = TabsOnRails::Tabs::TabsBuilder.new(self, :current => "active")
end

def test_inherits_from_builder
Expand Down Expand Up @@ -60,4 +61,14 @@ def test_tab_for_with_item_options
@builder.tab_for(:welcome, "Welcome", "#", :style => "padding: 10px")
end

def test_tab_for_with_item_options_current
assert_dom_equal %Q{<li class="custom active"><span>Dashboard</span></li>},
@bootbldr.tab_for(:dashboard, "Dashboard", "#", :class => "custom")
assert_dom_equal %Q{<li class="custom"><a href="#">Welcome</a></li>},
@bootbldr.tab_for(:welcome, "Welcome", "#", :class => "custom")
assert_dom_equal %Q{<li style="padding: 10px" class="active"><span>Dashboard</span></li>},
@bootbldr.tab_for(:dashboard, "Dashboard", "#", :style => "padding: 10px")
assert_dom_equal %Q{<li style="padding: 10px"><a href="#">Welcome</a></li>},
@bootbldr.tab_for(:welcome, "Welcome", "#", :style => "padding: 10px")
end
end
4 changes: 4 additions & 0 deletions test/views/working/with_item_options_current.html.erb
@@ -0,0 +1,4 @@
<%= tabs_tag(:open_tabs => { :id => "tabs", :current => "active" }, :close_tabs => { :class => "ignored" }) do |tabs| %>
<%= tabs.dashboard 'Dashboard', '/d', :class => "custom" %>
<%= tabs.welcome 'Welcome', '/w', :class => "custom" %>
<% end -%>

0 comments on commit 5a33b5f

Please sign in to comment.