Sha256: 30864ef8ef4c0cea67901d5b1f8bef3cd326eb76ea8afbd6962bb7126636428e
Contents?: true
Size: 610 Bytes
Versions: 33
Compression:
Stored size: 610 Bytes
Contents
require 'spec_helper' describe "For Loops" do let(:products) { Dugway.store.products } let(:products_drop) { Dugway::Drops::ProductsDrop.new(products) } it "should render each product name" do template = rendered_template("{% for product in products.all %} {{product.name}} {% endfor %}", 'products' => products_drop) products.each do |product| template.should =~ /#{Regexp.escape(product['name'])}/ end end private def rendered_template(template, assigns={}) Liquid::Template.parse(template).render(assigns, :registers => { :currency => Dugway.store.currency }) end end
Version data entries
33 entries across 33 versions & 1 rubygems