Sha256: 6ae5549db31c24ec46fa8307b6e5d53983bbafcd690013f58227bbf87923e658

Contents?: true

Size: 729 Bytes

Versions: 5

Compression:

Stored size: 729 Bytes

Contents

require "test_helper"
require "cell/partial"

class PartialTest < MiniTest::Spec
  class WithPartial < Cell::ViewModel
    self.view_paths = ['test/fixtures'] # doesn't exist.
    self.template_engine = :erb

    include Partial

    def show
      render partial: "../fixtures/partials/show.html"
    end

    def show_with_format
      render partial: "../fixtures/partials/show", formats: [:xml]
    end

    def show_without_partial
      render :show
    end
  end

  it { WithPartial.new(nil).show.must_equal "I Am Wrong And I Am Right" }
  it { WithPartial.new(nil).show_with_format.must_equal "<xml>I Am Wrong And I Am Right</xml>" }
  it { WithPartial.new(nil).show_without_partial.must_equal "Adenosine Breakdown" }
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
cells-4.0.0.beta5 test/partial_test.rb
cells-4.0.0.beta4 test/partial_test.rb
cells-4.0.0.beta3 test/partial_test.rb
cells-4.0.0.beta2 test/partial_test.rb
cells-4.0.0.beta1 test/partial_test.rb