Sha256: 408adaf9349281f0b7b4d107bb91f05777e90a905c33ed6ff1d193ea94b8a808

Contents?: true

Size: 856 Bytes

Versions: 11

Compression:

Stored size: 856 Bytes

Contents

require 'rails_helper'

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

  context 'cell rendering' do
  <%- actions.each_with_index do |state, index| -%>
    context 'rendering <%= state %>' do
      subject { cell(<%= cell_name %>, <%= class_name %>.new).call(:<%= 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 %>.<%= template_engine %>') }
      <%- else -%>
      it { is_expected.to include '<%= class_name %>#<%= state %>' }
      it { is_expected.to include 'Find me in app/cells/<%= file_path %>/<%= state %>.<%= template_engine %>' }
      <%- end -%>
    end
    <%- unless index == actions.length - 1 -%>

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

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
rspec-cells-0.3.10 lib/generators/rspec/templates/cell_spec.erb
rspec-cells-0.3.9 lib/generators/rspec/templates/cell_spec.erb
rspec-cells-0.3.8 lib/generators/rspec/templates/cell_spec.erb
rspec-cells-0.3.7 lib/generators/rspec/templates/cell_spec.erb
rspec-cells-0.3.6 lib/generators/rspec/templates/cell_spec.erb
rspec-cells-0.3.5 lib/generators/rspec/templates/cell_spec.erb
rspec-cells-0.3.4 lib/generators/rspec/templates/cell_spec.erb
rspec-cells-0.3.3 lib/generators/rspec/templates/cell_spec.erb
rspec-cells-0.3.2 lib/generators/rspec/templates/cell_spec.erb
rspec-cells-0.3.1 lib/generators/rspec/templates/cell_spec.erb
rspec-cells-0.3.0 lib/generators/rspec/templates/cell_spec.erb