Sha256: fa918e34c4018c98788c027530116b31ea069213869e949db35e778407657769

Contents?: true

Size: 446 Bytes

Versions: 9

Compression:

Stored size: 446 Bytes

Contents

require 'test_helper'

class CellTest < MiniTest::Spec
  class SongCell < Cell::ViewModel
    self.view_paths = ['test/fixtures']

    def show
    end

    def show_with_block(&block)
      render(&block)
    end
  end

  # #options
  it { SongCell.new(nil, genre: "Punkrock").send(:options)[:genre].must_equal "Punkrock" }

  # #block
  it { SongCell.new(nil, genre: "Punkrock").(:show_with_block) { "hello" }.must_equal "<b>hello</b>\n" }
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
cells-4.1.7 test/cell_test.rb
cells-4.1.6 test/cell_test.rb
cells-4.1.5 test/cell_test.rb
cells-4.1.4 test/cell_test.rb
cells-4.1.3 test/cell_test.rb
cells-4.1.2 test/cell_test.rb
cells-4.1.1 test/cell_test.rb
cells-4.1.0 test/cell_test.rb
cells-4.1.0.rc1 test/cell_test.rb