Created
February 9, 2013 00:01
-
-
Save danielevans/4743016 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
describe "_clip.html.erb" do | |
let(:context) { | |
o = Object.new | |
o.class_eval do | |
def erb_binding # bypass the fact that binding is private and send(:binding) seems to have wierd side-effects | |
binding | |
end | |
end | |
o | |
} | |
let(:erb) { ERB.new(File.read("app/views/email_templates/_clip.html.erb")) } | |
let(:result) { erb.result(context.erb_binding) } | |
before(:each) do | |
context.stub(:clip_url).and_return("abc") | |
end | |
it "renders a link to the clip url" do | |
result.should match(/<a[^>]*href=\"abc\"/) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment