Sha256: 59f681a627656b9e906082bede945b0a19e3c40b64ec9f03f6492e5736d63cbc

Contents?: true

Size: 649 Bytes

Versions: 4

Compression:

Stored size: 649 Bytes

Contents

require_all File.dirname(__FILE__) + '/helpers'

module Erb::RailsForm
  module ContentMatchers
    def have_form_for name
      have_block :form_for, :args => name
    end

    def self.form_helpers
      [:check_box, :file_field, :hidden_field, :label, :password_field, :radio_button, :text_area]
    end

    form_helpers.each do |name|
      class_eval %{
        def have_#{name} obj_name, args=nil  
          args = args ? ":\#{obj_name}, \#{args}" : ":\#{obj_name}"
          have_form_call :#{name}, :args => args
        end        
      }
    end
      
    include LinkHelpers
    include OptionHelpers
    include TagHelpers
  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/have_form.rb
forms-spec-0.1.1 lib/forms-spec/erb/matchers/rails_view/have_form.rb
forms-spec-0.1.0 lib/forms-spec/erb/matchers/rails_view/have_form.rb
code-spec-0.1.3 lib/code_spec/erb/matchers/rails_view/have_form.rb