Sha256: 8945977c3d7cd63d38075c234f5311ffd851195961ec160bcf8d40889d858d4f

Contents?: true

Size: 904 Bytes

Versions: 46

Compression:

Stored size: 904 Bytes

Contents

require 'spec_helper'

describe ActiveAdmin::ViewHelpers::FormHelper do
  describe ".hidden_field_tags_for" do
    let(:view) { action_view }

    it "should render hidden field tags for params" do
      view.hidden_field_tags_for(:scope => "All", :filter => "None").should == 
        %{<input id="hidden_active_admin_scope" name="scope" type="hidden" value="All" />\n<input id="hidden_active_admin_filter" name="filter" type="hidden" value="None" />}
    end

    it "should generate not default id for hidden input" do
      view.hidden_field_tags_for(:scope => "All")[/id="([^"]+)"/, 1].should_not == "scope"
    end

    it "should filter out the field passed via the option :except" do
      view.hidden_field_tags_for({:scope => "All", :filter => "None"}, :except => :filter).should == 
        %{<input id="hidden_active_admin_scope" name="scope" type="hidden" value="All" />}
    end
  end
end

Version data entries

46 entries across 46 versions & 2 rubygems

Version Path
lalala-4.0.0.dev.141 vendor/deps/active_admin/spec/unit/view_helpers/form_helper_spec.rb
lalala-4.0.0.dev.136 vendor/deps/active_admin/spec/unit/view_helpers/form_helper_spec.rb
lalala-4.0.0.dev.135 vendor/deps/active_admin/spec/unit/view_helpers/form_helper_spec.rb
lalala-4.0.0.dev.134 vendor/deps/active_admin/spec/unit/view_helpers/form_helper_spec.rb
lalala-4.0.0.dev.133 vendor/deps/active_admin/spec/unit/view_helpers/form_helper_spec.rb
lalala-4.0.0.dev.132 vendor/deps/active_admin/spec/unit/view_helpers/form_helper_spec.rb
lalala-4.0.0.dev.131 vendor/deps/active_admin/spec/unit/view_helpers/form_helper_spec.rb
lalala-4.0.0.dev.129 vendor/deps/active_admin/spec/unit/view_helpers/form_helper_spec.rb
lalala-4.0.0.dev.128 vendor/deps/active_admin/spec/unit/view_helpers/form_helper_spec.rb
lalala-4.0.0.dev.126 vendor/deps/active_admin/spec/unit/view_helpers/form_helper_spec.rb
lalala-4.0.0.dev.125 vendor/deps/active_admin/spec/unit/view_helpers/form_helper_spec.rb
lalala-4.0.0.dev.124 vendor/deps/active_admin/spec/unit/view_helpers/form_helper_spec.rb
lalala-4.0.0.dev.123 vendor/deps/active_admin/spec/unit/view_helpers/form_helper_spec.rb
lalala-4.0.0.dev.118 vendor/deps/active_admin/spec/unit/view_helpers/form_helper_spec.rb
lalala-4.0.0.dev.116 vendor/deps/active_admin/spec/unit/view_helpers/form_helper_spec.rb
lalala-4.0.0.dev.114 vendor/deps/active_admin/spec/unit/view_helpers/form_helper_spec.rb
lalala-4.0.0.dev.113 vendor/deps/active_admin/spec/unit/view_helpers/form_helper_spec.rb
lalala-4.0.0.dev.111 vendor/deps/active_admin/spec/unit/view_helpers/form_helper_spec.rb
lalala-4.0.0.dev.109 vendor/deps/active_admin/spec/unit/view_helpers/form_helper_spec.rb
lalala-4.0.0.dev.107 vendor/deps/active_admin/spec/unit/view_helpers/form_helper_spec.rb