Sha256: 1b04a84368347e03d63f308dd10d75cc25b4df5079c16874e992ac986c71a670

Contents?: true

Size: 674 Bytes

Versions: 4

Compression:

Stored size: 674 Bytes

Contents

# encoding: utf-8
require 'spec_helper'

RSpec.describe 'Rails field_error_proc' do

  include FormtasticSpecHelper

  before do
    @output_buffer = ''
    mock_everything
  end

  it "should not be overridden globally for all form builders" do
    current_field_error_proc = ::ActionView::Base.field_error_proc

    semantic_form_for(@new_post) do |builder|
      expect(::ActionView::Base.field_error_proc).not_to eq(current_field_error_proc)
    end

    expect(::ActionView::Base.field_error_proc).to eq(current_field_error_proc)

    form_for(@new_post) do |builder|
      expect(::ActionView::Base.field_error_proc).to eq(current_field_error_proc)
    end
  end

end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
date_n_time_picker_activeadmin-0.1.2 vendor/bundle/ruby/2.6.0/gems/formtastic-4.0.0/spec/builder/error_proc_spec.rb
date_n_time_picker_activeadmin-0.1.1 vendor/bundle/ruby/2.6.0/gems/formtastic-4.0.0/spec/builder/error_proc_spec.rb
formtastic-4.0.0 spec/builder/error_proc_spec.rb
formtastic-4.0.0.rc1 spec/builder/error_proc_spec.rb