Sha256: aef52cc4a2ae0a7251139ae4a6e215662922ccadabe1fc1d8113abe74ab8fcef

Contents?: true

Size: 674 Bytes

Versions: 8

Compression:

Stored size: 674 Bytes

Contents

require 'spec_helper'

describe StringComponent do

  include RSpec::Rails::RequestExampleGroup

  context 'form' do

    it 'should render form field' do
      @category = Fabricate :category
      get admin_categories_path

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

      component.should have_selector('label[for=category_title]')
      component.should have_selector("input[type=text][value='#{@category.title}']")
    end

  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

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