Sha256: 9940d490bb55c04dd7113dbeecf64f5f2a47f4b149a2b7d91c6219da3e9e9623

Contents?: true

Size: 820 Bytes

Versions: 2

Compression:

Stored size: 820 Bytes

Contents

require 'spec_helper'

describe SelectComponent do

  include RSpec::Rails::RequestExampleGroup

  context 'form' do

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

      field = controller.form_fields[:status]
      field.options[:type] = :select
      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_status]')
      component.should have_selector('select') do |select|
        Post.statuses.each do |status|
          select.should have_selector("option[value='#{status}']", :content => status)
        end
      end
    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
puffer-0.1.1 spec/components/select_component_spec.rb
puffer-0.1.0 spec/app/components/select_component_spec.rb