Sha256: 315557e517459e3b54ea6da1e65440050764c1b2621fbc1f04e464d6634e06af

Contents?: true

Size: 729 Bytes

Versions: 5

Compression:

Stored size: 729 Bytes

Contents

require 'test_helper'

class AlbumCell < Cell::Rails
  self_contained!

  def cover
    @title = "The Sufferer & The Witness"
    render
  end

  class SongCell < self
  end
end

unless Cell.rails_version.~("3.0")

  class SelfContainedTest < MiniTest::Spec
    include Cell::TestCase::TestMethods

    let (:album) { cell(:album) }

    it "renders views from album/views/" do
     album.render_state(:cover).must_equal "<h3>The Sufferer &amp; The Witness</h3>\n"
    end

    describe "#_prefixes" do
      it { cell("album")._prefixes.must_equal(["album/views"]) }
      it { cell("album_cell/song")._prefixes.must_equal(["album_cell/song/views", "album/views"]) } # this is semi-cool, but the old behaviour.
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
cells-jamie-4.0.0.alpha1 test/self_contained_test.rb
cells-3.11.3 test/self_contained_test.rb
cells-3.11.2 test/self_contained_test.rb
cells-3.11.1 test/self_contained_test.rb
cells-3.11.0 test/self_contained_test.rb