Merge pull request #3039 from consul/legislation-dates

[Backport] Legislation dates
This commit is contained in:
Alberto
2018-11-14 13:31:54 +01:00
committed by GitHub
2 changed files with 16 additions and 1 deletions

View File

@@ -1,6 +1,6 @@
module LegislationHelper
def format_date(date)
l(date, format: "%d %h %Y") if date
l(date, format: "%d %b %Y") if date
end
def format_date_for_calendar_form(date)

View File

@@ -47,6 +47,21 @@ feature 'Legislation' do
end
end
scenario 'Key dates are displayed on current locale' do
process = create(:legislation_process, proposals_phase_start_date: Date.new(2018, 01, 01),
proposals_phase_end_date: Date.new(2018, 12, 01))
visit legislation_process_path(process)
expect(page).to have_content("Proposals")
expect(page).to have_content("01 Jan 2018 - 01 Dec 2018")
visit legislation_process_path(process, locale: "es")
expect(page).to have_content("Propuestas")
expect(page).to have_content("01 ene 2018 - 01 dic 2018")
end
scenario 'Filtering processes' do
create(:legislation_process, title: "Process open")
create(:legislation_process, :next, title: "Process next")