Commit 64e03235c905ddec85dd3dbf135b94b8085510cc

Authored by AntonioTerceiro
1 parent 21c0927b

ActionItem642: fixing tests (fuck, Aurélio!)

git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@2461 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing 1 changed file with 10 additions and 6 deletions   Show diff stats
test/unit/lightbox_helper_test.rb
... ... @@ -4,6 +4,10 @@ class LightboxHelperTest < Test::Unit::TestCase
4 4  
5 5 include LightboxHelper
6 6  
  7 + def setup
  8 + stubs(:_).with(anything).returns('TEXT')
  9 + end
  10 +
7 11 should 'include lightbox properly' do
8 12 expects(:stylesheet_link_tag).with('lightbox').returns('[lightbox.css]')
9 13 expects(:javascript_include_tag).with('lightbox').returns('[lightbox.js]')
... ... @@ -16,36 +20,36 @@ class LightboxHelperTest < Test::Unit::TestCase
16 20 end
17 21  
18 22 should 'provide lightbox_link_to helper' do
19   - expects(:link_to).with('text', { :action => 'view', :id => '1' }, { :class => 'lbOn', :id => 'my-link' }).returns('[link]')
  23 + expects(:link_to).with('text', { :action => 'view', :id => '1' }, has_entries({ :class => 'lbOn', :id => 'my-link' })).returns('[link]')
20 24 assert_equal '[link]', lightbox_link_to('text', { :action => 'view', :id => '1'}, { :id => 'my-link' })
21 25 end
22 26  
23 27 should 'merge existing :class option in lightbox_link_to' do
24   - expects(:link_to).with('text', { :action => 'view', :id => '1' }, { :class => 'lbOn my-button', :id => 'my-link' }).returns('[link]')
  28 + expects(:link_to).with('text', { :action => 'view', :id => '1' }, has_entries({ :class => 'lbOn my-button', :id => 'my-link' })).returns('[link]')
25 29 assert_equal '[link]', lightbox_link_to('text', { :action => 'view', :id => '1'}, { :class => 'my-button', :id => 'my-link' })
26 30  
27 31 end
28 32  
29 33 should 'provide link to close lightbox' do
30   - expects(:button).with(:close, 'text', '#', { :class => 'lbAction', :rel => 'deactivate', :id => 'my-id' }).returns('[close-lightbox]')
  34 + expects(:button).with(:close, 'text', '#', has_entries({ :class => 'lbAction', :rel => 'deactivate', :id => 'my-id' })).returns('[close-lightbox]')
31 35  
32 36 assert_equal '[close-lightbox]', lightbox_close_button('text', :id => 'my-id')
33 37 end
34 38  
35 39 should 'merge existing :class option in lightbox_close_button' do
36   - expects(:button).with(:close, 'text', '#', { :class => 'lbAction my-class', :rel => 'deactivate', :id => 'my-id' }).returns('[close-lightbox]')
  40 + expects(:button).with(:close, 'text', '#', has_entries({ :class => 'lbAction my-class', :rel => 'deactivate', :id => 'my-id' })).returns('[close-lightbox]')
37 41  
38 42 assert_equal '[close-lightbox]', lightbox_close_button('text', :class => 'my-class', :id => 'my-id' )
39 43 end
40 44  
41 45 should 'provide lightbox_button' do
42   - expects(:button).with('type', 'label', { :action => 'popup'}, { :class => 'lbOn' }).returns('[button]')
  46 + expects(:button).with('type', 'label', { :action => 'popup'}, has_entries({ :class => 'lbOn' })).returns('[button]')
43 47  
44 48 assert_equal '[button]', lightbox_button('type', 'label', { :action => 'popup'})
45 49 end
46 50  
47 51 should 'provide lightbox_icon_button' do
48   - expects(:icon_button).with('type', 'label', { :action => 'popup'}, { :class => 'lbOn' }).returns('[button]')
  52 + expects(:icon_button).with('type', 'label', { :action => 'popup'}, has_entries({ :class => 'lbOn' })).returns('[button]')
49 53  
50 54 assert_equal '[button]', lightbox_icon_button('type', 'label', { :action => 'popup'})
51 55 end
... ...