Skip to content

Commit

Permalink
Fix Picture and Attachment specs for MySQL
Browse files Browse the repository at this point in the history
These specs would previously fail as their element's updated at would
not, actually, be `3.hours.ago`, but `Time.current - $TESTRUNTIME`. This
is more explicit with setting the column, and fixes the specs.
  • Loading branch information
mamhoff committed Apr 12, 2021
1 parent b3f53ad commit c76eafe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions spec/models/alchemy/attachment_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,12 @@ module Alchemy
let(:attachment) { create(:alchemy_attachment) }

let(:content) do
create(:alchemy_content, :essence_file).tap do |content|
content.element.update_column(:updated_at, 3.hours.ago)
end
create(:alchemy_content, :essence_file)
end

before do
content.essence.update(attachment: attachment)
content.element.update_column(:updated_at, 3.hours.ago)
end

it "touches elements" do
Expand Down
5 changes: 2 additions & 3 deletions spec/models/alchemy/picture_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -512,13 +512,12 @@ module Alchemy
let(:picture) { create(:alchemy_picture) }

let(:content) do
create(:alchemy_content, :essence_picture).tap do |content|
content.element.update_column(:updated_at, 3.hours.ago)
end
create(:alchemy_content, :essence_picture)
end

before do
content.essence.update(picture: picture)
content.element.update_column(:updated_at, 3.hours.ago)
end

it "touches elements" do
Expand Down

0 comments on commit c76eafe

Please sign in to comment.