Sha256: 33ee0b0876b7fbbfe8a02bccac287ff732fe06ec345d22b57ad66d741a45aa29
Contents?: true
Size: 1.1 KB
Versions: 7
Compression:
Stored size: 1.1 KB
Contents
require 'rails_helper' require 'bh/core_ext/rails/form_for_helper' include Bh::Rails::Helpers describe 'legend' do let(:protect_against_forgery?) { false } let(:form) { form_for User.new, layout: layout, url: '/', &block } let(:block) { Proc.new {|f| f.legend 'Basic info' } } let(:layout) { :whatever } specify 'adds a <legend> to the form' do expect(form).to include 'legend' end describe 'given a basic layout' do let(:layout) { :basic } specify 'applies form-group to the container' do expect(form).to match %r{<div class="form-group"><legend>Basic info</legend></div>} end end describe 'given a horizontal layout' do let(:layout) { :horizontal } specify 'applies form-group to the container, col-sm-12 to the field container' do expect(form).to match %r{<div class="form-group"><div class="col-sm-12"><legend>Basic info</legend></div>} end end describe 'given an inline layout' do let(:layout) { :inline } specify 'applies sr-only to the legend' do expect(form).to match %r{<legend class="sr-only">Basic info</legend>} end end end
Version data entries
7 entries across 7 versions & 1 rubygems