Commit bc17e0777e6461810df394a1763a978b05432697
1 parent
b9d985e2
Exists in
master
and in
28 other branches
ActionItem152: changing lightbox_close to generate a button
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1207 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
2 changed files
with
3 additions
and
3 deletions
Show diff stats
app/helpers/lightbox_helper.rb
... | ... | @@ -9,7 +9,7 @@ module LightboxHelper |
9 | 9 | end |
10 | 10 | |
11 | 11 | def lightbox_close(text, options = {}) |
12 | - link_to(text, '#', lightbox_options(options, 'lbAction').merge(:rel => 'deactivate')) | |
12 | + button(:close, text, '#', lightbox_options(options, 'lbAction').merge(:rel => 'deactivate')) | |
13 | 13 | end |
14 | 14 | |
15 | 15 | def lightbox_button(type, label, url, options = {}) | ... | ... |
test/unit/lightbox_helper_text.rb
... | ... | @@ -27,13 +27,13 @@ class LightboxHelperTest < Test::Unit::TestCase |
27 | 27 | end |
28 | 28 | |
29 | 29 | should 'provide link to close lightbox' do |
30 | - expects(:link_to).with('text', '#', { :class => 'lbAction', :rel => 'deactivate', :id => 'my-id' }).returns('[close-lightbox]') | |
30 | + expects(:button).with(:close, 'text', '#', { :class => 'lbAction', :rel => 'deactivate', :id => 'my-id' }).returns('[close-lightbox]') | |
31 | 31 | |
32 | 32 | assert_equal '[close-lightbox]', lightbox_close('text', :id => 'my-id') |
33 | 33 | end |
34 | 34 | |
35 | 35 | should 'merge existing :class option in lightbox_close' do |
36 | - expects(:link_to).with('text', '#', { :class => 'lbAction my-class', :rel => 'deactivate', :id => 'my-id' }).returns('[close-lightbox]') | |
36 | + expects(:button).with(:close, 'text', '#', { :class => 'lbAction my-class', :rel => 'deactivate', :id => 'my-id' }).returns('[close-lightbox]') | |
37 | 37 | |
38 | 38 | assert_equal '[close-lightbox]', lightbox_close('text', :class => 'my-class', :id => 'my-id' ) |
39 | 39 | end | ... | ... |