Skip to content

Commit

Permalink
wrap a test that uses Mocha in #uses_mocha block for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
mislav committed Dec 12, 2008
1 parent f2a8a59 commit a6d5b07
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions test/view_test.rb
Expand Up @@ -192,13 +192,15 @@ def test_page_entries_info
@html_result
end

def test_page_entries_info_with_longer_class_name
@template = '<%= page_entries_info collection %>'
collection = ('a'..'z').to_a.paginate
collection.first.stubs(:class).returns(mock('class', :name => 'ProjectType'))
uses_mocha 'class name' do
def test_page_entries_info_with_longer_class_name
@template = '<%= page_entries_info collection %>'
collection = ('a'..'z').to_a.paginate
collection.first.stubs(:class).returns(mock('class', :name => 'ProjectType'))

paginate collection
assert @html_result.index('project types'), "expected <#{@html_result.inspect}> to mention 'project types'"
paginate collection
assert @html_result.index('project types'), "expected <#{@html_result.inspect}> to mention 'project types'"
end
end

def test_page_entries_info_with_single_page_collection
Expand Down

0 comments on commit a6d5b07

Please sign in to comment.