Sha256: 6efd3bb4d0cf90d6c7c4b5feaf0975bbe1d3540e70c28f5a60312da781ef85f7

Contents?: true

Size: 1.46 KB

Versions: 17

Compression:

Stored size: 1.46 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe Surveyor::Common, "" do
  it "should convert text to a code that is more appropirate for a database entry" do
    # A few answers from the survey
    { "This? is a in - t3rrible-@nswer of! (question) on" => "this_t3rrible_nswer",
      "Private insurance/ HMO/ PPO" => "private_insurance_hmo_ppo",
      "<bold>VA</bold>" => "va",
      "PMS (Premenstrual syndrome)/ PMDD (Premenstrual Dysphoric Disorder)" => "pms_pmdd",
      "Have never been employed outside the home" => "never_been_employed_outside_home",
      "Professional" => "professional",
      "Not working because of temporary disability, but expect to return to a job" => "temporary_disability_expect_return_job",
      "How long has it been since you last visited a doctor for a routine checkup (routine being not for a particular reason)?" => "visited_doctor_for_routine_checkup",
      "Do you take medications as directed?" => "you_take_medications_as_directed",
      "Do you every leak urine (or) water when you didn't want to?" => "urine_water_you_didnt_want", #checking for () and ' removal
      "Do your biological family members (not adopted) have a \"history\" of any of the following?" => "family_members_history_any_following",
      "Your health:" => "your_health",
      "In general, you would say your health is:" => "you_would_say_your_health"
    }.each{|k, v| Surveyor::Common.to_normalized_string(k).should == v}
  end
  
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
surveyor-0.21.0 spec/lib/common_spec.rb
surveyor-0.20.0 spec/lib/common_spec.rb
surveyor-0.19.7 spec/lib/common_spec.rb
surveyor-0.19.6 spec/lib/common_spec.rb
surveyor-0.19.5 spec/lib/common_spec.rb
surveyor-0.19.4 spec/lib/common_spec.rb
surveyor-0.19.3 spec/lib/common_spec.rb
surveyor-0.19.2 spec/lib/common_spec.rb
surveyor-0.19.1 spec/lib/common_spec.rb
surveyor-0.19.0 spec/lib/common_spec.rb
surveyor-0.18.2 spec/lib/common_spec.rb
surveyor-0.18.1 spec/lib/common_spec.rb
surveyor-0.18.0 spec/lib/common_spec.rb
surveyor-0.17.0 spec/lib/common_spec.rb
surveyor-0.16.1 spec/lib/common_spec.rb
surveyor-0.16.0 spec/lib/common_spec.rb
surveyor-0.15.0 spec/lib/common_spec.rb