Sha256: 1c81af5b84f8a813b0d62cff8a2ad9bfa5b1dc36c10306380ccad60926406353

Contents?: true

Size: 721 Bytes

Versions: 5

Compression:

Stored size: 721 Bytes

Contents

require "test_helper"
require "cell/partial"

class PartialTest < MiniTest::Spec
  class WithPartial < Cell::ViewModel
    self.view_paths = ['test/fixtures'] # doesn't exist.
    include ::Cell::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.2 test/partial_test.rb
cells-4.0.1 test/partial_test.rb
cells-4.0.0 test/partial_test.rb
cells-4.0.0.rc1 test/partial_test.rb
cells-4.0.0.beta6 test/partial_test.rb