Created
November 14, 2013 19:04
-
-
Save Lordnibbler/7472451 to your computer and use it in GitHub Desktop.
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 is_page?(page) | |
if params | |
params["id"] == page && params["controller"] == "high_voltage/pages" | |
else | |
false | |
end | |
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 ApplicationHelper do | |
describe ".is_page?(page)" do | |
it "returns true if we're on the page with ID passed as page arg" do | |
# need to set our controller params to something like: | |
# params = {id: 'a_page', controller:'high_voltage/pages'} | |
helper.is_page?('a_page').should == true | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment