Last active
August 29, 2015 14:10
-
-
Save ryankbales/c532e7a7153ea5d85c62 to your computer and use it in GitHub Desktop.
template_exists?
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
#content_helper, starting at line no. 428 | |
#was | |
if template_exists?(part.part.partial, "content", true) | |
#solution | |
if lookup_context.template_exists?(part.part.partial, ["content"], true) | |
#spec edit | |
#content_helper_spec.rb starting on line no. 2303 | |
#was | |
before do | |
@client = double(:client) | |
@store = double(:store) | |
helper.stub(:template_exists? => true) | |
end | |
it "returns an empty string on a deleted partial" do | |
helper.stub(:template_exists? => false) | |
helper.content_for_part(part).should == "" | |
end | |
#solution, stub_chain template_exists on lookup_context | |
before do | |
@client = double(:client) | |
@store = double(:store) | |
helper.stub_chain(:lookup_context, :template_exists? => true) | |
end | |
it "returns an empty string on a deleted partial" do | |
helper.stub_chain(:lookup_context, :template_exists? => false) | |
helper.content_for_part(part).should == "" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment