Merge pull request #1734 from consul/fix/localize_date

Fix date localization
This commit is contained in:
Raimond Garcia
2017-07-10 12:02:07 +02:00
committed by GitHub
2 changed files with 4 additions and 3 deletions

View File

@@ -13,7 +13,7 @@
<div class="milestone-content">
<h3><%= milestone.title %></h3>
<span class="milestone-date">
<strong><%= t("budgets.investments.show.milestone_publish_date", publish_date: milestone.created_at.strftime("%d/%m/%Y")) %></strong>
<strong><%= t("budgets.investments.show.milestone_publish_date", publish_date: l(milestone.created_at.to_date)) %></strong>
</span>
<p><%= milestone.description %></p>
</div>

View File

@@ -392,7 +392,8 @@ feature 'Budget Investments' do
scenario "Show milestones", :js do
user = create(:user)
investment = create(:budget_investment)
milestone = create(:budget_investment_milestone, investment: investment, title: "New text to show")
milestone = create(:budget_investment_milestone, investment: investment, title: "New text to show",
created_at: DateTime.new(2015, 9, 19).utc)
login_as(user)
visit budget_investment_path(budget_id: investment.budget.id, id: investment.id)
@@ -402,7 +403,7 @@ feature 'Budget Investments' do
within("#tab-milestones") do
expect(page).to have_content(milestone.title)
expect(page).to have_content(milestone.description)
expect(page).to have_content("Published #{milestone.created_at.strftime("%d/%m/%Y")}")
expect(page).to have_content("Published 2015-09-19")
end
end