Sha256: d4b000cf5746937fa30783f904cd3203b31ea95fe39d772ead23df16cb094e4e

Contents?: true

Size: 969 Bytes

Versions: 5

Compression:

Stored size: 969 Bytes

Contents

require 'spec_helper'

describe <%= class_name %>Cell do

  context "cell instance" do
    subject { cell(<%= cell_name %>) }

    <%- for state in actions -%>
    it { should respond_to(:<%= state %>) }
    <%- end -%>
  end

  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 { should have_selector("h1", :text => "<%= class_name %>#<%= state %>") }
      it { should have_selector("p", :text => "Find me in app/cells/<%= file_path %>/<%= state %>.html") }
      <%- else -%>
      it { should have_selector("h1", :content => "<%= class_name %>#<%= state %>") }
      it { should have_selector("p", :content => "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.1.9 lib/generators/rspec/templates/cell_spec.erb
rspec-cells-0.1.8 lib/generators/rspec/templates/cell_spec.erb
rspec-cells-0.1.7 lib/generators/rspec/templates/cell_spec.erb
rspec-cells-0.1.6 lib/generators/rspec/templates/cell_spec.erb
rspec-cells-0.1.5 lib/generators/rspec/templates/cell_spec.erb