Time.now -> Time.current

This commit is contained in:
kikito
2016-11-23 19:19:19 +01:00
parent 4782332691
commit f0b8cfd4a2
52 changed files with 262 additions and 265 deletions

View File

@@ -62,9 +62,9 @@ feature 'Commenting debates' do
end
scenario 'Comment order' do
c1 = create(:comment, :with_confidence_score, commentable: debate, cached_votes_up: 100, cached_votes_total: 120, created_at: Time.now - 2)
c2 = create(:comment, :with_confidence_score, commentable: debate, cached_votes_up: 10, cached_votes_total: 12, created_at: Time.now - 1)
c3 = create(:comment, :with_confidence_score, commentable: debate, cached_votes_up: 1, cached_votes_total: 2, created_at: Time.now)
c1 = create(:comment, :with_confidence_score, commentable: debate, cached_votes_up: 100, cached_votes_total: 120, created_at: Time.current - 2)
c2 = create(:comment, :with_confidence_score, commentable: debate, cached_votes_up: 10, cached_votes_total: 12, created_at: Time.current - 1)
c3 = create(:comment, :with_confidence_score, commentable: debate, cached_votes_up: 1, cached_votes_total: 2, created_at: Time.current)
visit debate_path(debate, order: :most_voted)
@@ -83,10 +83,10 @@ feature 'Commenting debates' do
end
scenario 'Creation date works differently in roots and in child comments, even when sorting by confidence_score' do
old_root = create(:comment, commentable: debate, created_at: Time.now - 10)
new_root = create(:comment, commentable: debate, created_at: Time.now)
old_child = create(:comment, commentable: debate, parent_id: new_root.id, created_at: Time.now - 10)
new_child = create(:comment, commentable: debate, parent_id: new_root.id, created_at: Time.now)
old_root = create(:comment, commentable: debate, created_at: Time.current - 10)
new_root = create(:comment, commentable: debate, created_at: Time.current)
old_child = create(:comment, commentable: debate, parent_id: new_root.id, created_at: Time.current - 10)
new_child = create(:comment, commentable: debate, parent_id: new_root.id, created_at: Time.current)
visit debate_path(debate, order: :most_voted)
@@ -418,7 +418,7 @@ feature 'Commenting debates' do
feature 'Voting comments' do
background do
@manuela = create(:user, verified_at: Time.now)
@manuela = create(:user, verified_at: Time.current)
@pablo = create(:user)
@debate = create(:debate)
@comment = create(:comment, commentable: @debate)