Sha256: aceecade8ae1d16dec287a3d1c9d6ce614219d57c682bea2e1db30c6cdfc1e2a

Contents?: true

Size: 774 Bytes

Versions: 5

Compression:

Stored size: 774 Bytes

Contents

require 'spec_helper'

module Tim
  describe "/tim/image_versions/_image_version" do
    before(:each) do
      view.stub(:image_version).and_return FactoryGirl.build(:image_version)
      [:image_version_url].each do |method|
        view.stub(method)
      end
    end

    it "should render custom content partial when it is defined" do
      render
      view.should render_template(:partial => "_custom", :count => 1)
      Hash.from_xml(rendered)["image_version"].keys.include?("custom_content")
        .should == true
    end

    it "should not fail to render when a content partial is not defined" do
      view.controller.stub(:template_exists?).and_return false
      render
      view.should render_template(:partial => "_custom", :count => 0)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
tim-0.3.0 spec/views/image_versions_spec.rb
tim-0.2.0 spec/views/image_versions_spec.rb
tim-0.1.2 spec/views/image_versions_spec.rb
tim-0.1.1 spec/views/image_versions_spec.rb
tim-0.0.1 spec/views/image_versions_spec.rb