Sha256: dc4595daacafcf12f2d07dabc2f37649002cf444e0f4922e0da2e0444b6bd474

Contents?: true

Size: 629 Bytes

Versions: 8

Compression:

Stored size: 629 Bytes

Contents

require 'spec_helper'

describe TextComponent do

  include RSpec::Rails::RequestExampleGroup

  context 'form' do

    it 'should render form field' do
      @post = Fabricate :post
      get admin_posts_path

      field = controller.form_fields[:body]
      component = ''
      controller.view_context.form_for @post, :url => admin_post_path(@post) do |form|
        component = Puffer::Component::Base.render_component(controller, field, :form, :form => form)
      end

      component.should have_selector('label[for=post_body]')
      component.should have_selector('textarea', :content => @post.body)
    end

  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
puffer-0.0.32 spec/app/components/text_component_spec.rb
puffer-0.0.31 spec/app/components/text_component_spec.rb
puffer-0.0.30 spec/app/components/text_component_spec.rb
puffer-0.0.29 spec/app/components/text_component_spec.rb
puffer-0.0.28 spec/app/components/text_component_spec.rb
puffer-0.0.26 spec/app/components/text_component_spec.rb
puffer-0.0.25 spec/app/components/text_component_spec.rb
puffer-0.0.24 spec/app/components/text_component_spec.rb