Created
October 2, 2012 14:46
-
-
Save kylewelsby/3819720 to your computer and use it in GitHub Desktop.
testing a application helper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def active_tab | |
link_to("Homepage", root_path, :class => ("active" if current_page? root_path)) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe "#active_tab" do | |
it "has a active class" do | |
helper.stub :current_path? => true | |
helper.active_tab.should have_selector :a, :class => 'active' | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
+1