Commit 114fd5d4b67246ff6a38e78e18498eac6725cf41
Exists in
master
and in
22 other branches
Merge commit 'refs/merge-requests/147' of git://gitorious.org/noosfero/noosfero …
…into merge-requests/147 (ActionItem2322)
Showing
2 changed files
with
13 additions
and
1 deletions
Show diff stats
app/views/blocks/featured_products.rhtml
... | ... | @@ -14,7 +14,7 @@ |
14 | 14 | <div class="featured-product-text"> |
15 | 15 | <h3><%= p.name %></h3> |
16 | 16 | <p class="featured-product-price"><%= float_to_currency(p.price) %></p> |
17 | - <p class="featured-product-desc"><%= p.description.chars[0...50].to_s + '...' %></p> | |
17 | + <p class="featured-product-desc"><%= truncate(p.description, 50, '...') %></p> | |
18 | 18 | <p><%= link_to _('See More'), product_path(p), :class => 'featured-product-link' %></p> |
19 | 19 | </div> |
20 | 20 | </div> | ... | ... |
features/featured_products_block.feature
... | ... | @@ -20,6 +20,7 @@ Feature: featured_products_block |
20 | 20 | | owner | category | name | description | highlighted | |
21 | 21 | | redemoinho | automobile | Car | Red Car | true | |
22 | 22 | | redemoinho | automobile | Truck | Blue Truck | true | |
23 | + | redemoinho | automobile | Moto | Very long description of and auto-mobile moto to be truncated | true | | |
23 | 24 | And I am logged in as "eddievedder" |
24 | 25 | |
25 | 26 | @selenium |
... | ... | @@ -33,3 +34,14 @@ Feature: featured_products_block |
33 | 34 | Then I should see "Car" |
34 | 35 | And I should not see "float_to_currency" |
35 | 36 | And I should not see "product_path" |
37 | + | |
38 | + @selenium | |
39 | + Scenario: display block with long description | |
40 | + Given I follow "Manage my groups" | |
41 | + And I follow "Control panel of this group" | |
42 | + And I follow "Edit sideboxes" | |
43 | + And I follow "Edit" within ".featured-products-block" | |
44 | + And I select "Moto" | |
45 | + And I press "Save" | |
46 | + When I am on redemoinho's homepage | |
47 | + Then I should see "Very long description of and auto-mobile moto to b..." | ... | ... |