Sha256: 8294d48c1e2352f07b821cb2041593e78de70b562853e144aa090e14d540e203

Contents?: true

Size: 825 Bytes

Versions: 4

Compression:

Stored size: 825 Bytes

Contents

module Erb::RailsForm
  module ContentMatchers
    module TagHelpers
      def have_field_set_tag legend
        have_form_call :field_set_tag, :args => "'#{legend}'"
      end
    
      def have_form_tag url
        have_form_call :form_tag, :args => "'#{url}'"
      end
    
      def have_password_field_tag name = "password"
        have_form_call :password_field_tag, :args => "'#{name}'"
      end

      def self.tags_list
        [ :check_box_tag, :file_field_tag, :text_field_tag, :hidden_field_tag, :image_submit_tag, 
          :radio_button_tag, :select_tag, :label_tag, :submit_tag, :text_area_tag ]
      end

      tags_list.each do |name|
        class_eval %{
          def have_#{name} name
            have_form_call :#{name}, :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/tags.rb
forms-spec-0.1.1 lib/forms-spec/erb/matchers/rails_view/helpers/tags.rb
forms-spec-0.1.0 lib/forms-spec/erb/matchers/rails_view/helpers/tags.rb
code-spec-0.1.3 lib/code_spec/erb/matchers/rails_view/helpers/tags.rb