Sha256: 0fe3396a95b25a3e7acdb373ce3053385535eefd11b3ade906aec52557ac0abc

Contents?: true

Size: 612 Bytes

Versions: 4

Compression:

Stored size: 612 Bytes

Contents

require 'spec_helper'

describe 'rendering html' do
  let(:attributes) { {} }
  let(:resolver) { HungryForm::Resolver.new }
  let(:group) { HungryForm::Elements::Group.new(:group, nil, resolver, visible: true) {} }
  let(:field) { HungryForm::Elements::Html.new(:field_name, group, resolver, attributes) }
  let(:render_params) {
    {
      partial: 'hungryform/html',
      locals: { field: field }
    }
  }

  it_behaves_like 'it is wrapped in a div'

  it 'has a body' do
    attributes[:value] = '<a href="">link</a>'
    render render_params
    expect(rendered).to include '<a href="">link</a>'
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
hungryform-rails-0.0.6 spec/views/html_spec.rb
hungryform-rails-0.0.5 spec/views/html_spec.rb
hungryform-rails-0.0.4 spec/views/html_spec.rb
hungryform-rails-0.0.3 spec/views/html_spec.rb