Sha256: 9075a3e572f67d34a5e84ef110dab97a898577465805766a7466d581aaa758f6

Contents?: true

Size: 864 Bytes

Versions: 1

Compression:

Stored size: 864 Bytes

Contents

require 'spec_helper'

describe ApplicationController do
  it "should be able to tag framgents" do
    Cashier.should_receive(:store_fragment).with('views/key', 'tag')
    controller.write_fragment('key', 'content', :tag => 'tag')
  end

  it "should be able write a fragment with multiple tags" do
    Cashier.should_receive(:store_fragment).with('views/key', 'tag1', 'tag2')
    controller.write_fragment('key', 'content', :tag => %w(tag1 tag2))
  end

  it "should able to create a tag with a proc" do
    Cashier.should_receive(:store_fragment).with('views/key', 'tag')
    controller.write_fragment('key', 'content', :tag => proc {|c| 'tag' })
  end

  it "should able to create a tag with a lambda" do
    Cashier.should_receive(:store_fragment).with('views/key', 'tag')
    controller.write_fragment('key', 'content', :tag => lambda {|c| 'tag' })
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cashier-0.4.0 spec/controllers/application_controller_spec.rb