Sha256: 8fa857b2b66aabf1febcd74609b19879a188d09d0a64324d0a1154568f6fc8cc

Contents?: true

Size: 901 Bytes

Versions: 3

Compression:

Stored size: 901 Bytes

Contents

require File.dirname(__FILE__) + "/../spec_helper"

describe FacturaePrint::Renderers::HTMLRenderer do
  
  it "should render the given template with the given invoice object as @invoice instance variable" do
    templ = "Example with <%= @invoice.name %>"
    fake_invoice = OpenStruct.new("name" => "My first invoice ever")
    html_renderer = FacturaePrint::Renderers::HTMLRenderer.new(templ, fake_invoice)
    html_renderer.render.should == "Example with My first invoice ever"
  end
  
  it "should make FacturaePrint::Renderers::HTMLRendererHelpers methods available" do
    templ = "Example with <%= @invoice.name %> for a value of 6000 <%= currency_code('USD') %>"
    fake_invoice = OpenStruct.new("name" => "My first invoice ever")
    html_renderer = FacturaePrint::Renderers::HTMLRenderer.new(templ, fake_invoice)
    "Example with My first invoice ever for a value of 6000 $"
  end
  
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
facturae_print-0.0.4 spec/renderers/html_renderer_spec.rb
facturae_print-0.0.3 spec/renderers/html_renderer_spec.rb
facturae_print-0.0.2 spec/renderers/html_renderer_spec.rb