Sha256: 256e66c5cef504e76ea8e954b153e4d509f518ce3866c9b53ef671109028a93b

Contents?: true

Size: 836 Bytes

Versions: 4

Compression:

Stored size: 836 Bytes

Contents

module Erb::RailsForm
  module ContentMatchers
    module OptionHelpers
      def self.options_methods
        [ :grouped_collection_select, :option_groups_from_collection_for_select, :option_groups_from_collection_for_select, 
          :options_from_collection_for_select, :time_zone_options_for_select ]
      end

      options_methods.each do |name|
        class_eval %{
          def have_#{name} name
            have_form_call :#{name}
          end
        }
      end

      def self.name_options_methods       
        [ :collection_select, :grouped_collection_select, :select, :time_zone_select ]
      end

      name_options_methods.each do |name|
        class_eval %{
          def have_#{name} name
            have_form_call :collection_select, :args => ":#{name}"
          end
        }
      end
    end 
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
forms-spec-0.1.2 lib/forms-spec/erb/matchers/rails_view/helpers/options.rb
forms-spec-0.1.1 lib/forms-spec/erb/matchers/rails_view/helpers/options.rb
forms-spec-0.1.0 lib/forms-spec/erb/matchers/rails_view/helpers/options.rb
code-spec-0.1.3 lib/code_spec/erb/matchers/rails_view/helpers/options.rb