Replace created at date to start and end date on admin legislation processes
This commit is contained in:
@@ -17,7 +17,8 @@
|
||||
<tr>
|
||||
<th><%= t("admin.legislation.processes.process.title") %></th>
|
||||
<th><%= t("admin.legislation.processes.process.status") %></th>
|
||||
<th><%= t("admin.legislation.processes.process.creation_date") %></th>
|
||||
<th class="text-center"><%= t("admin.legislation.processes.process.start_date") %></th>
|
||||
<th class="text-center"><%= t("admin.legislation.processes.process.end_date") %></th>
|
||||
<th class="text-center"><%= t("admin.legislation.processes.process.comments") %></th>
|
||||
<th><%= t("admin.actions.actions") %></th>
|
||||
</tr>
|
||||
@@ -26,11 +27,12 @@
|
||||
<tbody>
|
||||
<% @processes.each do |process| %>
|
||||
<tr id="<%= dom_id(process) %>">
|
||||
<td class="small-12 medium-6">
|
||||
<td class="small-12 medium-6 large-4">
|
||||
<%= link_to process.title, edit_admin_legislation_process_path(process) %>
|
||||
</td>
|
||||
<td><%= t("admin.legislation.processes.process.status_#{process.status}") %></td>
|
||||
<td><%= I18n.l process.created_at.to_date %></td>
|
||||
<td class="text-center"><%= I18n.l process.start_date %></td>
|
||||
<td class="text-center"><%= I18n.l process.end_date %></td>
|
||||
<td class="text-center"><%= process.total_comments %></td>
|
||||
<td>
|
||||
<%= link_to t("admin.legislation.processes.index.delete"), admin_legislation_process_path(process),
|
||||
|
||||
@@ -456,7 +456,8 @@ en:
|
||||
title: Process
|
||||
comments: Comments
|
||||
status: Status
|
||||
creation_date: Creation date
|
||||
start_date: Start date
|
||||
end_date: End date
|
||||
status_open: Open
|
||||
status_closed: Closed
|
||||
status_planned: Planned
|
||||
|
||||
@@ -456,7 +456,8 @@ es:
|
||||
title: Proceso
|
||||
comments: Comentarios
|
||||
status: Estado
|
||||
creation_date: Fecha de creación
|
||||
start_date: Fecha de apertura
|
||||
end_date: Fecha de cierre
|
||||
status_open: Abierto
|
||||
status_closed: Cerrado
|
||||
status_planned: Próximamente
|
||||
|
||||
@@ -50,14 +50,22 @@ feature "Admin legislation processes" do
|
||||
end
|
||||
|
||||
scenario "Processes are sorted by descending start date" do
|
||||
create(:legislation_process, title: "Process 1", start_date: Date.yesterday)
|
||||
create(:legislation_process, title: "Process 2", start_date: Date.today)
|
||||
create(:legislation_process, title: "Process 3", start_date: Date.tomorrow)
|
||||
process_1 = create(:legislation_process, title: "Process 1", start_date: Date.yesterday)
|
||||
process_2 = create(:legislation_process, title: "Process 2", start_date: Date.today)
|
||||
process_3 = create(:legislation_process, title: "Process 3", start_date: Date.tomorrow)
|
||||
|
||||
visit admin_legislation_processes_path(filter: "all")
|
||||
|
||||
expect("Process 3").to appear_before("Process 2")
|
||||
expect("Process 2").to appear_before("Process 1")
|
||||
expect(page).to have_content (process_1.start_date)
|
||||
expect(page).to have_content (process_2.start_date)
|
||||
expect(page).to have_content (process_3.start_date)
|
||||
|
||||
expect(page).to have_content (process_1.end_date)
|
||||
expect(page).to have_content (process_2.end_date)
|
||||
expect(page).to have_content (process_3.end_date)
|
||||
|
||||
expect(process_3.title).to appear_before(process_2.title)
|
||||
expect(process_2.title).to appear_before(process_1.title)
|
||||
end
|
||||
|
||||
end
|
||||
@@ -179,6 +187,14 @@ feature "Admin legislation processes" do
|
||||
expect(page).not_to have_content "Summary of the process"
|
||||
expect(page).to have_css("img[alt='#{Legislation::Process.last.title}']")
|
||||
end
|
||||
|
||||
scenario "Default colors are present" do
|
||||
visit new_admin_legislation_process_path
|
||||
|
||||
expect(find("#legislation_process_background_color").value).to eq "#e7f2fc"
|
||||
expect(find("#legislation_process_font_color").value).to eq "#222222"
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
context "Update" do
|
||||
|
||||
Reference in New Issue
Block a user