Commit b7642d12eac80a69cde70ea707828c00dcf8268d

Authored by Antonio Terceiro
1 parent ee3d786b

Make tests less picky

Also removed a useless test for PublishedArticle

(ActionItem1668,ActionItem1664)
test/functional/home_controller_test.rb
... ... @@ -71,9 +71,9 @@ all_fixtures
71 71  
72 72  
73 73 get :index
74   - assert_tag :tag => 'p', :content => a1.abstract
75   - assert_no_tag :tag => 'p', :content => a1.body
76   - assert_tag :tag => 'p', :content => a2.body
  74 + assert_tag :attributes => { :class => 'headline' }, :content => a1.abstract
  75 + assert_no_tag :attributes => { :class => 'headline' }, :content => a1.body
  76 + assert_tag :attributes => { :class => 'headline' }, :content => a2.body
77 77 end
78 78  
79 79 should 'display block in index page if it\'s configured to display on homepage and its an environment block' do
... ...
test/unit/invite_member_test.rb
... ... @@ -95,7 +95,7 @@ class InviteMemberTest < ActiveSupport::TestCase
95 95 community = fast_create(Community)
96 96 task = InviteMember.create!(:person => p1, :friend => p2, :community_id => community.id)
97 97  
98   - assert_equal "#{p1.name} invites you to join the community #{community.name}.", task.description
  98 + assert_match(/#{p1.name}.*#{community.name}/, task.description)
99 99 end
100 100  
101 101 should 'not invite yourself' do
... ...
test/unit/published_article_test.rb
... ... @@ -137,12 +137,4 @@ class PublishedArticleTest < ActiveSupport::TestCase
137 137 assert_equal p.parent, new_parent
138 138 end
139 139  
140   - should 'provide first paragraph of HTML version' do
141   - prof = fast_create(Community)
142   - a = fast_create(Article, :name => 'my article', :profile_id => prof.id)
143   - a.expects(:body).returns('<p>the first paragraph of the article</p> The second paragraph')
144   - p = PublishedArticle.create(:reference_article => a, :profile => prof)
145   - assert_equal 'the first paragraph of the article', p.first_paragraph
146   - end
147   -
148 140 end
... ...