Skip to content

Instantly share code, notes, and snippets.

@Lordnibbler
Created November 14, 2013 19:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Lordnibbler/7472451 to your computer and use it in GitHub Desktop.
Save Lordnibbler/7472451 to your computer and use it in GitHub Desktop.
def is_page?(page)
if params
params["id"] == page && params["controller"] == "high_voltage/pages"
else
false
end
end
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