Sha256: 786795be9ddf2894b9b9d8f488223c0f6c6ed19cf8250f4c0f8708d6b32cc277

Contents?: true

Size: 494 Bytes

Versions: 6

Compression:

Stored size: 494 Bytes

Contents

require 'spec_helper'

class DummyCell < Cell::ViewModel
  def show
    "<p>I'm Dummy.</p>"
  end

  def update
    "Updating #{options[:what]}."
  end
end

class SongCell < Cell::ViewModel
  def show
    "#{model}!"
  end
end

describe "Cell::Testing in specs", type: :cell do
  describe "#cell" do
    it { expect(cell(:dummy).call).to have_text("I'm Dummy.") }

    # with user options.
    it { expect(cell(:song, "Don't Have The Cow").call).to have_text("Don't Have The Cow!") }
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rspec-cells-0.3.8 spec/cells/cell_spec_spec.rb
rspec-cells-0.3.7 spec/cells/cell_spec_spec.rb
rspec-cells-0.3.6 spec/cells/cell_spec_spec.rb
rspec-cells-0.3.5 spec/cells/cell_spec_spec.rb
rspec-cells-0.3.4 spec/cells/cell_spec_spec.rb
rspec-cells-0.3.3 spec/cells/cell_spec_spec.rb