Sha256: 39ad75616f2875a454d9f7f9d4c9a859427c269ef9ccb5e578cf4c37401859c1

Contents?: true

Size: 792 Bytes

Versions: 5

Compression:

Stored size: 792 Bytes

Contents

require 'spec_helper'

describe <%= class_name %>Cell, type: :cell do

  context 'cell rendering' do
  <%- actions.each_with_index do |state, index| -%>
    context 'rendering <%= state %>' do
      subject { render_cell(<%= cell_name %>, :<%= state %>) }

      <%- if defined?(::Capybara) -%>
      it { is_expected.to have_selector('h1', text: '<%= class_name %>#<%= state %>') }
      it { is_expected.to have_selector('p', text: 'Find me in app/cells/<%= file_path %>/<%= state %>.html') }
      <%- else -%>
      it { is_expected.to include '<%= class_name %>#<%= state %>' }
      it { is_expected.to include 'Find me in app/cells/<%= file_path %>/<%= state %>.html' }
      <%- end -%>
    end
    <%- unless index == actions.length - 1 -%>

    <%- end -%>
  <%- end -%>
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rspec-cells-0.2.5 lib/generators/rspec/templates/cell_spec.erb
rspec-cells-0.2.4 lib/generators/rspec/templates/cell_spec.erb
rspec-cells-0.2.3 lib/generators/rspec/templates/cell_spec.erb
rspec-cells-0.2.2 lib/generators/rspec/templates/cell_spec.erb
rspec-cells-0.2.1 lib/generators/rspec/templates/cell_spec.erb