Added year to showed creation date and ordered by date DESC
Backported from AyuntamientoMadrid/consul fork
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
class Admin::SignatureSheetsController < Admin::BaseController
|
class Admin::SignatureSheetsController < Admin::BaseController
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@signature_sheets = SignatureSheet.all
|
@signature_sheets = SignatureSheet.all.order(created_at: :desc)
|
||||||
end
|
end
|
||||||
|
|
||||||
def new
|
def new
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
<%= signature_sheet.author.name %>
|
<%= signature_sheet.author.name %>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<%= l(signature_sheet.created_at, format: :short) %>
|
<%= l(signature_sheet.created_at, format: :long) %>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
<div class="callout secondary float-right">
|
<div class="callout secondary float-right">
|
||||||
<%= t("admin.signature_sheets.show.created_at") %>
|
<%= t("admin.signature_sheets.show.created_at") %>
|
||||||
<strong><%= l(@signature_sheet.created_at, format: :short) %></strong>
|
<strong><%= l(@signature_sheet.created_at, format: :long) %></strong>
|
||||||
<span class="bullet"> • </span>
|
<span class="bullet"> • </span>
|
||||||
<%= t("admin.signature_sheets.show.author") %>
|
<%= t("admin.signature_sheets.show.author") %>
|
||||||
<strong><%= @signature_sheet.author.name %></strong>
|
<strong><%= @signature_sheet.author.name %></strong>
|
||||||
|
|||||||
@@ -7,7 +7,8 @@ feature 'Signature sheets' do
|
|||||||
login_as(admin.user)
|
login_as(admin.user)
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario "Index" do
|
context "Index" do
|
||||||
|
scenario 'Lists all signature_sheets' do
|
||||||
3.times { create(:signature_sheet) }
|
3.times { create(:signature_sheet) }
|
||||||
|
|
||||||
visit admin_signature_sheets_path
|
visit admin_signature_sheets_path
|
||||||
@@ -19,6 +20,18 @@ feature 'Signature sheets' do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
scenario 'Orders signature_sheets by created_at DESC' do
|
||||||
|
signature_sheet1 = create(:signature_sheet)
|
||||||
|
signature_sheet2 = create(:signature_sheet)
|
||||||
|
signature_sheet3 = create(:signature_sheet)
|
||||||
|
|
||||||
|
visit admin_signature_sheets_path
|
||||||
|
|
||||||
|
expect(signature_sheet3.name).to appear_before(signature_sheet2.name)
|
||||||
|
expect(signature_sheet2.name).to appear_before(signature_sheet1.name)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
context 'Create' do
|
context 'Create' do
|
||||||
scenario 'Proposal' do
|
scenario 'Proposal' do
|
||||||
proposal = create(:proposal)
|
proposal = create(:proposal)
|
||||||
@@ -78,7 +91,7 @@ feature 'Signature sheets' do
|
|||||||
|
|
||||||
expect(page).to have_content "Citizen proposal #{proposal.id}"
|
expect(page).to have_content "Citizen proposal #{proposal.id}"
|
||||||
expect(page).to have_content "12345678Z, 123A, 123B"
|
expect(page).to have_content "12345678Z, 123A, 123B"
|
||||||
expect(page).to have_content signature_sheet.created_at.strftime("%d %b %H:%M")
|
expect(page).to have_content signature_sheet.created_at.strftime("%B %d, %Y %H:%M")
|
||||||
expect(page).to have_content user.name
|
expect(page).to have_content user.name
|
||||||
|
|
||||||
within("#document_count") do
|
within("#document_count") do
|
||||||
|
|||||||
Reference in New Issue
Block a user