This commit is contained in:
Brenda Wallace
2019-04-20 15:10:08 +12:00
parent 33460bb171
commit f86177e78f
3 changed files with 5 additions and 5 deletions

View File

@@ -11,7 +11,7 @@ module HarvestsHelper
end
def display_human_quantity(harvest)
return unless harvest.quantity.present? && harvest.quantity > 0
return unless harvest.quantity.present? && harvest.quantity > 0
if harvest.unit == 'individual' # just the number
number_to_human(harvest.quantity, strip_insignificant_zeros: true)

View File

@@ -9,9 +9,9 @@ module SeedsHelper
def display_seed_description(seed)
if seed.description.present?
truncate(seed.description, length: 130, separator: ' ', omission: '... ') { link_to "Read more", seed_path(seed) }
else
''
return truncate(seed.description, length: 130, separator: ' ', omission: '... ') { link_to "Read more", seed_path(seed) }
end
''
end
end

View File

@@ -86,7 +86,7 @@ describe "plantings/show" do
end
it "shows the member's location in parentheses" do
expect(rendered).to have_content "#{planting.owner.location}"
expect(rendered).to have_content planting.owner.location.to_s
end
end
end