Remove DateTime.parse usage
While the correct usage would require an `in_time_zone` call, the code can be simplified and the relationship between the current date and the last `proposal.created_at + index.days` is now a bit easier to notice. We use the beginning of the month as the date of the first action because we expect all 8 actions to be created on the same month.
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
require "rails_helper"
|
||||
|
||||
describe Dashboard::AchievementsController do
|
||||
let(:created_at) { DateTime.parse("2018-01-01 12:00:00") }
|
||||
let(:proposal) { create(:proposal, created_at: created_at) }
|
||||
let(:proposal) { create(:proposal, created_at: 7.days.ago.beginning_of_month) }
|
||||
let(:executed_actions) { create_list(:dashboard_action, 8, :active, :proposed_action) }
|
||||
let!(:non_executed_actions) { create_list(:dashboard_action, 8, :active, :proposed_action) }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user