Created
August 25, 2011 21:11
-
-
Save ratnikov/1171978 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 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