Sha256: cdcb765d7a1a1932a3a40cc7ef56c6b5e5be579579a6bf1515039227999dde9d
Contents?: true
Size: 1.49 KB
Versions: 1
Compression:
Stored size: 1.49 KB
Contents
require File.expand_path(File.join(File.dirname(__FILE__), %w[.. spec_helper])) describe Ziya::Components::Draw do before( :each ) do @comp = Ziya::Components::Draw.new circle = Ziya::Components::Circle.new circle.radius = 10 image = Ziya::Components::Image.new image.x = 10 @comp.components = [circle, image] end it "should define the correct attribute methods" do lambda{ Ziya::Components::Draw.attributes[@comp.class.name].each { |m| @comp.send( m ) } }.should_not raise_error end describe "#flatten" do before( :each ) do @xml = Builder::XmlMarkup.new end it "should flatten component correctly" do @comp.flatten( @xml ).should == "<draw><circle radius=\"10\"/><image x=\"10\"/></draw>" end it "should support composite charts" do urls = { :fred => "/fred", :blee => "/blee" } @comp.flatten( @xml, urls ).should == "<draw><circle radius=\"10\"/><image x=\"10\"/><image url=\"/charts/charts.swf?library_path=/charts/charts_library&xml_source=%2Ffred&chart_id=fred\"/><image url=\"/charts/charts.swf?library_path=/charts/charts_library&xml_source=%2Fblee&chart_id=blee\"/></draw>" end it "should support js based composite chart" do urls = { :fred => nil } @comp.flatten( @xml, urls ).should == "<draw><circle radius=\"10\"/><image x=\"10\"/><image url=\"/charts/charts.swf?library_path=/charts/charts_library&chart_id=fred\"/></draw>" end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
derailed-ziya-2.0.8 | spec/components/draw_spec.rb |