Sha256: 10ed1b2279c65100e0acf71e0d257702191f92c29894e9b1c5916c89080730a9

Contents?: true

Size: 526 Bytes

Versions: 2

Compression:

Stored size: 526 Bytes

Contents

require 'test_helper'
require 'cell/twin'

if Cell.rails_version >= 3.1

class TwinTest < MiniTest::Spec
  class SongCell < Cell::ViewModel
    class Twin < Cell::Twin
      property :title
      option :online?
    end

    include Cell::Twin::Properties
    properties Twin

    def show
      "#{title} is #{online?}"
    end

    def title
      super.downcase
    end
  end

  let (:model) { OpenStruct.new(:title => "Kenny") }

  it { SongCell.new(nil, model, :online? => true).call.must_equal "kenny is true" }
end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cells-3.11.3 test/twin_test.rb
cells-3.11.2 test/twin_test.rb