diff --git a/spec/system/dashboard/dashboard_spec.rb b/spec/system/dashboard/dashboard_spec.rb index 319f0f6c5..a7c132ea3 100644 --- a/spec/system/dashboard/dashboard_spec.rb +++ b/spec/system/dashboard/dashboard_spec.rb @@ -484,10 +484,7 @@ describe "Proposal's dashboard" do end describe "detect_new_actions_after_last_login" do - before do - visit proposal_dashboard_path(proposal) - proposal.author.update!(last_sign_in_at: Date.yesterday) - end + before { proposal.author.update!(current_sign_in_at: 1.day.ago) } scenario "Display tag 'new' on resouce when it is new for author since last login" do resource = create(:dashboard_action, :resource, :active, day_offset: 0, @@ -503,7 +500,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.current) + proposal.author.update!(current_sign_in_at: Date.current) visit progress_proposal_dashboard_path(proposal) @@ -526,7 +523,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.current) + proposal.author.update!(current_sign_in_at: Date.current) visit progress_proposal_dashboard_path(proposal) @@ -547,7 +544,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.current) + proposal.author.update!(current_sign_in_at: Date.current) visit progress_proposal_dashboard_path(proposal)