Skip to content

Commit 19c4926

Browse files
committed
fix other specs
1 parent 30f8ab9 commit 19c4926

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

spec/models/gov_document_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
with_versioning do
2828
context "when removing attachment" do
2929
it "moves previous attachment to private folder" do
30-
expect(document.attachment.file.file).to match("/public/uploads")
30+
expect(document.attachment.file.file).to match(Rails.root.join("tmp/uploads").to_s)
3131
document.remove_attachment!
3232
document.save!
3333
document.reload
@@ -39,7 +39,7 @@
3939

4040
context "when changing attachment" do
4141
it "moves previous attachment to private folder" do
42-
expect(document.attachment.file.file).to match("/public/uploads")
42+
expect(document.attachment.file.file).to match(Rails.root.join("tmp/uploads").to_s)
4343
document.attachment = Rack::Test::UploadedFile.new(File.join(Rails.root, "spec", "support", "files", "doc.pdf"))
4444
document.save!
4545
document.reload
@@ -94,7 +94,7 @@
9494
with_versioning do
9595
context "when deleting" do
9696
it "moves attachment to private directory" do
97-
expect(document.attachment.file.file).to match("/public/uploads")
97+
expect(document.attachment.file.file).to match(Rails.root.join("tmp/uploads").to_s)
9898
document.destroy!
9999
document.reload
100100
expect(document.attachment.file.file).to match("/private/uploads")
@@ -114,7 +114,7 @@
114114
expect(document.attachment.file.file).to match("/private/uploads")
115115
document.restore
116116
reloaded_doc = GovDocument.find(document.id) # as reload does not reload paper_trail.live? weird
117-
expect(reloaded_doc.attachment.file.file).to match("/public/uploads")
117+
expect(reloaded_doc.attachment.file.file).to match(Rails.root.join("tmp/uploads").to_s)
118118
# first version should stay in private directory
119119
prev_version = reloaded_doc.versions[-2].reify
120120
expect(prev_version.attachment.file.file).to match("/private/uploads")

spec/models/observation_document_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
context "when deleting" do
3434
it "moves attachment to private directory" do
35-
expect(report.attachment.file.file).to match("/public/uploads")
35+
expect(report.attachment.file.file).to match(Rails.root.join("tmp/uploads").to_s)
3636
report.destroy!
3737
report.reload
3838
expect(report.attachment.file.file).to match("/private/uploads")
@@ -49,7 +49,7 @@
4949
expect(report.attachment.file.file).to match("/private/uploads")
5050
report.restore
5151
report.reload
52-
expect(report.attachment.file.file).to match("/public/uploads")
52+
expect(report.attachment.file.file).to match(Rails.root.join("tmp/uploads").to_s)
5353
end
5454
end
5555
end

spec/models/observation_report_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979

8080
context "when deleting" do
8181
it "moves attachment to private directory" do
82-
expect(report.attachment.file.file).to match("/public/uploads")
82+
expect(report.attachment.file.file).to match(Rails.root.join("tmp/uploads").to_s)
8383
report.destroy!
8484
report.reload
8585
expect(report.attachment.file.file).to match("/private/uploads")
@@ -96,7 +96,7 @@
9696
expect(report.attachment.file.file).to match("/private/uploads")
9797
report.restore
9898
report.reload
99-
expect(report.attachment.file.file).to match("/public/uploads")
99+
expect(report.attachment.file.file).to match(Rails.root.join("tmp/uploads").to_s)
100100
end
101101
end
102102
end

0 commit comments

Comments
 (0)