Commit 9eb43332c49fa4a9c4606c1ca078d8b26cffb1cc
1 parent
2c1a1d1a
Exists in
master
and in
23 other branches
ActionItem629: remove badly named, duplicated test
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@2438 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
1 changed file
with
0 additions
and
61 deletions
Show diff stats
test/unit/search_helper.rb
| @@ -1,61 +0,0 @@ | @@ -1,61 +0,0 @@ | ||
| 1 | -require File.dirname(__FILE__) + '/../test_helper' | ||
| 2 | - | ||
| 3 | -class SearchHelperTest < Test::Unit::TestCase | ||
| 4 | - | ||
| 5 | - include SearchHelper | ||
| 6 | - | ||
| 7 | - def _(any) | ||
| 8 | - any | ||
| 9 | - end | ||
| 10 | - | ||
| 11 | - def setup | ||
| 12 | - @profile = mock | ||
| 13 | - end | ||
| 14 | - attr_reader :profile | ||
| 15 | - | ||
| 16 | - include ActionView::Helpers::FormOptionsHelper | ||
| 17 | - include ActionView::Helpers::FormTagHelper | ||
| 18 | - include ActionView::Helpers::TagHelper | ||
| 19 | - should 'display profile info' do | ||
| 20 | - profile.stubs(:name).returns('Name of Profile') | ||
| 21 | - profile.stubs(:address).returns('Address of Profile') | ||
| 22 | - profile.stubs(:contact_email).returns('Email of Profile') | ||
| 23 | - profile.stubs(:contact_phone).returns('Phone of Profile') | ||
| 24 | - profile.stubs(:url).returns('') | ||
| 25 | - profile.stubs(:products).returns([Product.new(:name => 'product test')]) | ||
| 26 | - profile.stubs(:identifier).returns('name-of-profile') | ||
| 27 | - | ||
| 28 | - self.stubs(:profile_image).returns('profileimage.png') | ||
| 29 | - self.stubs(:url_for).returns('merda') | ||
| 30 | - self.stubs(:link_to).returns('link to profile') | ||
| 31 | - | ||
| 32 | - result = self.display_profile_info(profile) | ||
| 33 | - assert_match /profileimage.png/, result | ||
| 34 | - assert_match /link to profile/, result | ||
| 35 | - assert_match /Email of Profile/, result | ||
| 36 | - assert_match /Phone of Profile/, result | ||
| 37 | - assert_match /Address of Profile/, result | ||
| 38 | - end | ||
| 39 | - | ||
| 40 | - should 'not display field if nil in profile info' do | ||
| 41 | - profile.stubs(:name).returns('Name of Profile') | ||
| 42 | - profile.stubs(:address).returns('nil') | ||
| 43 | - profile.stubs(:contact_email).returns('nil') | ||
| 44 | - profile.stubs(:contact_phone).returns('nil') | ||
| 45 | - profile.stubs(:url).returns('') | ||
| 46 | - profile.stubs(:products).returns([Product.new(:name => 'product test')]) | ||
| 47 | - profile.stubs(:identifier).returns('name-of-profile') | ||
| 48 | - | ||
| 49 | - self.stubs(:profile_image).returns('profileimage.png') | ||
| 50 | - self.stubs(:url_for).returns('merda') | ||
| 51 | - self.stubs(:link_to).returns('link to profile') | ||
| 52 | - | ||
| 53 | - result = self.display_profile_info(profile) | ||
| 54 | - assert_match /profileimage.png/, result | ||
| 55 | - assert_match /link to profile/, result | ||
| 56 | - assert_no_match /Email of Profile/, result | ||
| 57 | - assert_no_match /Phone of Profile/, result | ||
| 58 | - assert_no_match /Address of Profile/, result | ||
| 59 | - end | ||
| 60 | - | ||
| 61 | -end |