tests: drop timecop gem.

This commit is contained in:
evazion
2019-08-18 03:50:43 -05:00
parent b15fd6d017
commit 27a118dfc8
24 changed files with 38 additions and 42 deletions

View File

@@ -139,7 +139,7 @@ class ArtistsControllerTest < ActionDispatch::IntegrationTest
should "update an artist" do
old_timestamp = @wiki_page.updated_at
travel_to(1.minute.from_now) do
travel(1.minute) do
put_auth artist_path(@artist.id), @user, params: {artist: {notes: "rex", url_string: "http://example.com\nhttp://monet.com"}}
end
@artist.reload
@@ -153,7 +153,7 @@ class ArtistsControllerTest < ActionDispatch::IntegrationTest
old_timestamp = @wiki_page.updated_at
old_updater_id = @wiki_page.updater_id
travel_to(1.minutes.from_now) do
travel(1.minute) do
as(@another_user) do
@artist.update(notes: "testing")
end

View File

@@ -76,10 +76,10 @@ class NotesControllerTest < ActionDispatch::IntegrationTest
context "revert action" do
setup do
as_user do
travel_to(1.day.from_now) do
travel(1.day) do
@note.update(:body => "111")
end
travel_to(2.days.from_now) do
travel(2.days) do
@note.update(:body => "222")
end
end

View File

@@ -31,7 +31,7 @@ class PostReplacementsControllerTest < ActionDispatch::IntegrationTest
@post.reload
end
travel_to(Time.now + PostReplacement::DELETION_GRACE_PERIOD + 1.day) do
travel(PostReplacement::DELETION_GRACE_PERIOD + 1.day) do
Delayed::Worker.new.work_off
end

View File

@@ -10,10 +10,10 @@ class PostVersionsControllerTest < ActionDispatch::IntegrationTest
setup do
@user.as_current do
@post = create(:post)
travel_to(2.hours.from_now) do
travel(2.hours) do
@post.update(:tag_string => "1 2", :source => "xxx")
end
travel_to(4.hours.from_now) do
travel(4.hours) do
@post.update(:tag_string => "2 3", :rating => "e")
end
@versions = @post.versions

View File

@@ -167,10 +167,10 @@ class WikiPagesControllerTest < ActionDispatch::IntegrationTest
as_user do
@wiki_page = create(:wiki_page, :body => "1")
end
travel_to(1.day.from_now) do
travel(1.day) do
@wiki_page.update(:body => "1 2")
end
travel_to(2.days.from_now) do
travel(2.days) do
@wiki_page.update(:body => "1 2 3")
end
end