Sha256: 1dc148896f41931813d33d8ce635512b01cf735d621931045040036804391213
Contents?: true
Size: 848 Bytes
Versions: 2
Compression:
Stored size: 848 Bytes
Contents
require 'spec_helper' describe 'rendering text field' do let(:attributes) { {} } let(:resolver) { HungryForm::Resolver.new } let(:group) { HungryForm::Elements::Group.new(:group, nil, resolver, visible: true) {} } let(:field) { HungryForm::Elements::TextField.new(:field_name, group, resolver, attributes) } let(:render_params) { { partial: 'hungryform/text_field', locals: { field: field } } } it_behaves_like 'it is wrapped in a div' it_behaves_like 'rendered active element' it_behaves_like 'labeled active element' it 'has an input' do render render_params expect(rendered).to match /<input.*id="group_field_name"/ end it 'has an input with value' do attributes[:value] = 'default value' render render_params expect(rendered).to match /<input.*value="default value"/ end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
hungryform-rails-0.0.6 | spec/views/text_field_spec.rb |
hungryform-rails-0.0.5 | spec/views/text_field_spec.rb |