Sha256: 13f04a1c4bff7c258714afa4e71ddd3dd0a22cecb4f224a29ee32eabbb34bbdd

Contents?: true

Size: 1.24 KB

Versions: 25

Compression:

Stored size: 1.24 KB

Contents

# encoding: utf-8
require 'spec_helper'

describe 'string input' do

  include FormtasticSpecHelper

  before do
    @output_buffer = ''
    mock_everything
  end

  describe "with_options and :wrapper_html" do
    before do
      concat(semantic_form_for(@new_post) do |builder|
        builder.with_options :wrapper_html => { :class => ['extra'] } do |opt_builder|
          concat(opt_builder.input(:title, :as => :string))
          concat(opt_builder.input(:author, :as => :radio))
        end
      end)
    end

    it "should have extra class on title" do
      output_buffer.should have_tag("form li#post_title_input.extra")
    end
    it "should have title as string" do
      output_buffer.should have_tag("form li#post_title_input.string")
    end
    it "should not have title as radio" do
      output_buffer.should_not have_tag("form li#post_title_input.radio")
    end

    it "should have extra class on author" do
      output_buffer.should have_tag("form li#post_author_input.extra")
    end
    it "should not have author as string" do
      output_buffer.should_not have_tag("form li#post_author_input.string")
    end
    it "should have author as radio" do
      output_buffer.should have_tag("form li#post_author_input.radio")
    end
  end
end

Version data entries

25 entries across 25 versions & 2 rubygems

Version Path
formtastic-3.1.5 spec/inputs/with_options_spec.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/formtastic-3.1.4/spec/inputs/with_options_spec.rb
formtastic-3.1.4 spec/inputs/with_options_spec.rb
formtastic-3.1.3 spec/inputs/with_options_spec.rb
formtastic-3.1.2 spec/inputs/with_options_spec.rb
formtastic-3.1.1 spec/inputs/with_options_spec.rb
formtastic-3.1.0 spec/inputs/with_options_spec.rb
formtastic-3.1.0.rc2 spec/inputs/with_options_spec.rb
formtastic-3.1.0.rc1 spec/inputs/with_options_spec.rb
formtastic-3.0.0 spec/inputs/with_options_spec.rb
formtastic-3.0.0.rc2 spec/inputs/with_options_spec.rb
formtastic-2.3.1 spec/inputs/with_options_spec.rb
formtastic-2.3.0 spec/inputs/with_options_spec.rb
formtastic-3.0.0.rc spec/inputs/with_options_spec.rb
formtastic-2.3.0.rc4 spec/inputs/with_options_spec.rb
formtastic-2.3.0.rc3 spec/inputs/with_options_spec.rb
formtastic-2.3.0.rc2 spec/inputs/with_options_spec.rb
formtastic-2.3.0.rc spec/inputs/with_options_spec.rb
formtastic-2.2.1 spec/inputs/with_options_spec.rb
formtastic-2.2.0 spec/inputs/with_options_spec.rb