Commit 56703bf0dc8d09997abaf452e98ebafe11810e49
1 parent
06ad5d30
Exists in
master
and in
29 other branches
Fix LinkListBlock unit test
Showing
2 changed files
with
5 additions
and
3 deletions
Show diff stats
app/models/link_list_block.rb
1 | 1 | class LinkListBlock < Block |
2 | 2 | |
3 | - attr_accessible :links | |
3 | + attr_accessible :links, :display | |
4 | 4 | |
5 | 5 | ICONS = [ |
6 | 6 | ['no-icon', _('(No icon)')], |
... | ... | @@ -52,7 +52,7 @@ class LinkListBlock < Block |
52 | 52 | def content(args={}) |
53 | 53 | block_title(title) + |
54 | 54 | content_tag('ul', |
55 | - links.select{|i| !i[:name].blank? and !i[:address].blank?}.map{|i| content_tag('li', link_html(i))} | |
55 | + links.select{|i| !i[:name].blank? and !i[:address].blank?}.map{|i| content_tag('li', link_html(i))}.join(',') | |
56 | 56 | ) |
57 | 57 | end |
58 | 58 | ... | ... |
test/unit/link_list_block_test.rb
... | ... | @@ -77,7 +77,9 @@ class LinkListBlockTest < ActiveSupport::TestCase |
77 | 77 | should 'be able to update display setting' do |
78 | 78 | user = create_user('testinguser').person |
79 | 79 | box = fast_create(Box, :owner_id => user.id) |
80 | - block = LinkListBlock.create!(:display => 'never', :box => box) | |
80 | + block = LinkListBlock.new(:display => 'never').tap do |b| | |
81 | + b.box = box | |
82 | + end | |
81 | 83 | assert block.update_attributes!(:display => 'always') |
82 | 84 | block.reload |
83 | 85 | assert_equal 'always', block.display | ... | ... |