~tim/wuparty

95ffe695fa4a525f586b31d46c007c2d29ce67e8 — Tim Morgan 8 years ago 87791d7
Fix tests, make a rake task.
4 files changed, 11 insertions(+), 5 deletions(-)

A .rvmrc
M README.rdoc
M Rakefile
M test/wuparty_test.rb
A .rvmrc => .rvmrc +1 -0
@@ 0,0 1,1 @@
rvm gemset use wuparty

M README.rdoc => README.rdoc +1 -1
@@ 96,7 96,7 @@ Make the name field required. Then run:
    WUFOO_ACCOUNT=accountname \
    WUFOO_API_KEY=AAAA-BBBB-CCCC-DDDD \
    WUFOO_FORM_ID=test-form \
    ruby -rrubygems test/wuparty_test.rb
    rake test

== License


M Rakefile => Rakefile +5 -0
@@ 15,3 15,8 @@ Grancher::Task.new do |g|
  g.message = 'Updated RDoc.'
  g.directory 'doc'
end


task :test do
  require('./test/wuparty_test')
end

M test/wuparty_test.rb => test/wuparty_test.rb +4 -4
@@ 1,4 1,4 @@
require File.dirname(__FILE__) + '/../lib/wuparty'
require './lib/wuparty'
require 'test/unit'

class WuPartyTest < Test::Unit::TestCase


@@ 55,8 55,8 @@ class WuPartyTest < Test::Unit::TestCase
  def test_form_fields
    form = @wufoo.form(@form_id)
    field_names = form.fields.map { |f| f['Title'] }
    assert field_names.include?('Name')
    assert field_names.include?('Address')
    assert field_names.include?('Name'), 'Name field not found in #fields'
    assert field_names.include?('Address'), 'Address field not found in #fields'
  end

  def test_form_submit


@@ 86,7 86,7 @@ class WuPartyTest < Test::Unit::TestCase
  def test_entries
    form = @wufoo.form(@form_id)
    form.submit('Field1' => 'Tim', 'Field2' => 'Morgan')
    assert form.entries.last['Field1'].any?
    assert_equal 'Tim', form.entries.last['Field1']
  end

  def test_filtering_entries