Use Date.current and Time.current

Using Date.today and Time.now might lead to inconsistencies if the time
zone the application uses is not the same as the system time zone.
This commit is contained in:
Javi Martín
2019-06-18 01:15:06 +02:00
parent 158f59ce0d
commit a21240b230
20 changed files with 34 additions and 34 deletions

View File

@@ -195,7 +195,7 @@ describe "Proposal's dashboard" do
end
scenario "Dashboard progress show available resources for published proposal" do
proposal.update(published_at: Date.today)
proposal.update(published_at: Date.current)
available = create(:dashboard_action, :resource, :active)
requested = create(:dashboard_action, :resource, :admin_request, :active)
@@ -481,7 +481,7 @@ describe "Proposal's dashboard" do
scenario "Not display tag 'new' on resouce when there is not new resources since last login" do
resource = create(:dashboard_action, :resource, :active, day_offset: 0,
published_proposal: false)
proposal.author.update(last_sign_in_at: Date.today)
proposal.author.update(last_sign_in_at: Date.current)
visit progress_proposal_dashboard_path(proposal)
@@ -504,7 +504,7 @@ describe "Proposal's dashboard" do
scenario "Not display tag 'new' on proposed_action when there is not new since last login" do
proposed_action = create(:dashboard_action, :proposed_action, :active, day_offset: 0,
published_proposal: false)
proposal.author.update(last_sign_in_at: Date.today)
proposal.author.update(last_sign_in_at: Date.current)
visit progress_proposal_dashboard_path(proposal)
@@ -525,7 +525,7 @@ describe "Proposal's dashboard" do
scenario "Not display tag 'new' on sidebar when there is not a new resouce since last login" do
create(:dashboard_action, :resource, :active, day_offset: 0, published_proposal: false)
proposal.author.update(last_sign_in_at: Date.today)
proposal.author.update(last_sign_in_at: Date.current)
visit progress_proposal_dashboard_path(proposal)