Sha256: 70962a097553586070c9deee357f3f016e1b355e8f5fa841c647499cdb3a94ce

Contents?: true

Size: 1.3 KB

Versions: 46

Compression:

Stored size: 1.3 KB

Contents

# -*- encoding : utf-8 -*-

RSpec.describe Bootstrap::Component::HorizontalForm do
  describe "horizontal form" do
    subject { Card["A"].format(:html) }

    let(:form) do
      subject.bs_horizontal_form 2, 10 do
        group do
          input "email", label: "Email Address", id: "theemail"
          input "password", label: "Password", id: "thepassword"
        end
        group do
          #checkbox "test", label: "checkbox label", id: "thecheckbox"
        end
      end
    end
    let(:bsform) do
      subject.bs do
        horizontal_form 2, 10 do
          group do
            input "email", label: "Email Address", id: "theemail"
            input "password", label: "Password", id: "thepassword"
          end
          group do
            checkbox "test", label: "checkbox label", id: "thecheckbox"
          end
        end
      end
    end

    it "creates form" do
      expect(form).to have_tag 'form.form-horizontal' do
        with_tag 'div.form-group' do
          with_tag 'label.col-sm-2.control-label[for="theemail"]', text: /Email Address/
          with_tag 'div.col-sm-10' do
            with_tag 'input.form-control#theemail[type="email"]'
          end
        end
        # with_tag 'div.form-group' do
        #   with_tag 'input[type="checkbox"]'
        # end
      end
    end
  end
end

Version data entries

46 entries across 46 versions & 1 rubygems

Version Path
card-1.100.0 mod/bootstrap/spec/set/all/bootstrap/horizontal_form_spec.rb
card-1.99.6 mod/bootstrap/spec/set/all/bootstrap/horizontal_form_spec.rb
card-1.99.5 mod/bootstrap/spec/set/all/bootstrap/horizontal_form_spec.rb
card-1.99.4 mod/bootstrap/spec/set/all/bootstrap/horizontal_form_spec.rb
card-1.99.3 mod/bootstrap/spec/set/all/bootstrap/horizontal_form_spec.rb
card-1.99.2 mod/bootstrap/spec/set/all/bootstrap/horizontal_form_spec.rb
card-1.99.1 mod/bootstrap/spec/set/all/bootstrap/horizontal_form_spec.rb
card-1.99.0 mod/bootstrap/spec/set/all/bootstrap/horizontal_form_spec.rb
card-1.98.3 mod/bootstrap/spec/set/all/bootstrap/horizontal_form_spec.rb
card-1.98.2 mod/bootstrap/spec/set/all/bootstrap/horizontal_form_spec.rb
card-1.98.1 mod/bootstrap/spec/set/all/bootstrap/horizontal_form_spec.rb
card-1.98.0 mod/bootstrap/spec/set/all/bootstrap/horizontal_form_spec.rb
card-1.97.0.1 mod/bootstrap/spec/set/all/bootstrap/horizontal_form_spec.rb
card-1.97.0 mod/bootstrap/spec/set/all/bootstrap/horizontal_form_spec.rb
card-1.96.8 mod/bootstrap/spec/set/all/bootstrap/horizontal_form_spec.rb
card-1.96.7 mod/bootstrap/spec/set/all/bootstrap/horizontal_form_spec.rb
card-1.96.6 mod/bootstrap/spec/set/all/bootstrap/horizontal_form_spec.rb
card-1.96.5 mod/bootstrap/spec/set/all/bootstrap/horizontal_form_spec.rb
card-1.96.4 mod/bootstrap/spec/set/all/bootstrap/horizontal_form_spec.rb
card-1.96.3 mod/bootstrap/spec/set/all/bootstrap/horizontal_form_spec.rb