Skip to content

Commit

Permalink
Cleanup tests
Browse files Browse the repository at this point in the history
  • Loading branch information
weppos committed Aug 9, 2010
1 parent b86216c commit 39eb14f
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions test/tabs/tabs_builder_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ def current_tab(namespace)

def setup
@template = Template.new
@builder = TabsOnRails::Tabs::TabsBuilder.new(@template)
@klass = TabsOnRails::Tabs::TabsBuilder
@builder = @klass.new(@template)
end

def test_should_extend_builder
assert_equal TabsOnRails::Tabs::Builder, @klass.superclass
end


Expand All @@ -41,18 +46,14 @@ def test_close_tabs_with_options
end


def test_should_implement_builder
assert_equal(TabsOnRails::Tabs::Builder, TabsOnRails::Tabs::TabsBuilder.superclass)
end

def test_tab_for_should_return_link_to_unless_current_tab
assert_dom_equal('<li><a href="#">Welcome</a></li>', @builder.tab_for(:welcome, 'Welcome', '#'))
assert_dom_equal('<li><a href="http://foobar.com/">Foo Bar</a></li>', @builder.tab_for(:welcome, 'Foo Bar', 'http://foobar.com/'))
assert_dom_equal '<li><a href="#">Welcome</a></li>', @builder.tab_for(:welcome, 'Welcome', '#')
assert_dom_equal '<li><a href="http://foobar.com/">Foo Bar</a></li>', @builder.tab_for(:welcome, 'Foo Bar', 'http://foobar.com/')
end

def test_tab_for_should_return_span_if_current_tab
assert_dom_equal('<li><span>Dashboard</span></li>', @builder.tab_for(:dashboard, 'Dashboard', '#'))
assert_dom_equal('<li><span>Foo Bar</span></li>', @builder.tab_for(:dashboard, 'Foo Bar', '#'))
assert_dom_equal '<li><span>Dashboard</span></li>', @builder.tab_for(:dashboard, 'Dashboard', '#')
assert_dom_equal '<li><span>Foo Bar</span></li>', @builder.tab_for(:dashboard, 'Foo Bar', '#')
end

end

0 comments on commit 39eb14f

Please sign in to comment.