Skip to content

Instantly share code, notes, and snippets.

@ratnikov
Created August 25, 2011 21:11
Show Gist options
  • Save ratnikov/1171978 to your computer and use it in GitHub Desktop.
Save ratnikov/1171978 to your computer and use it in GitHub Desktop.
def new_list_item_link
content_for :action_links do
link_to "New #{controller.controller_name.humanize.titleize.singularize}", eval("new_managed_lists_#{controller.controller_name.singularize}_path")
end
end
describe "#new_list_item_link" do
before do
helper.should_receive(:new_managed_lists_test_path).and_return 'test_path_url'
helper.new_list_item_link
end
it "should add a link to action_links" do
helper.content_for(:action_links).should have_selector("a[@href=test_path_url]")
end
end
#OUTPUT
NameError: undefined local variable or method `new_managed_lists_test_path' for #<#<Class:0xb23f630>:0xb3b1fa4>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment