Class: ODDB::TestHospital

Inherits:
Test::Unit::TestCase
  • Object
show all
Includes:
FlexMock::TestCase
Defined in:
test/test_model/hospital.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) setup



14
15
16
# File 'test/test_model/hospital.rb', line 14

def setup
  @hospital = Hospital.new('12543')
end

- (Object) test_contact



17
18
19
20
21
22
# File 'test/test_model/hospital.rb', line 17

def test_contact
  assert_nil @hospital.contact
  addr = @hospital.addresses.first
  addr.name = 'A Name'
  assert_equal 'A Name', @hospital.contact
end

- (Object) test_pointer_descr



23
24
25
26
27
# File 'test/test_model/hospital.rb', line 23

def test_pointer_descr
  @hospital.name = 'Hospital'
  @hospital.business_unit = 'Neurologie'
  assert_equal 'Hospital Neurologie', @hospital.pointer_descr
end

- (Object) test_search_terms



28
29
30
31
32
33
34
35
36
37
# File 'test/test_model/hospital.rb', line 28

def test_search_terms
  @hospital.name = 'A Name'
  @hospital.business_unit = 'Neurologie'
  @hospital. = 'hospital@test.ch'
  @hospital.addresses.replace [ flexmock(:search_terms => ['Address', 'Terms'])]
  expected = [
    "A Name", "12543", "Neurologie", "hospitaltestch", "Address", "Terms"
  ]
  assert_equal expected, @hospital.search_terms
end

- (Object) test_search_text



38
39
40
41
42
43
44
45
# File 'test/test_model/hospital.rb', line 38

def test_search_text
  @hospital.name = 'A Name'
  @hospital.business_unit = 'Neurologie'
  @hospital. = 'hospital@test.ch'
  @hospital.addresses.replace [ flexmock(:search_terms => ['Address', 'Terms'])]
  expected = "A Name 12543 Neurologie hospitaltestch Address Terms"
  assert_equal expected, @hospital.search_text
end