Sha256: d4893a0e97d003c90e55351591d1ee0db05775251e4d15e89b2971415b39a45d

Contents?: true

Size: 495 Bytes

Versions: 2

Compression:

Stored size: 495 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

2 entries across 2 versions & 1 rubygems

Version Path
rspec-cells-0.3.2 spec/cells/cell_spec_spec.rb
rspec-cells-0.3.1 spec/cells/cell_spec_spec.rb