Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Floppy committed Oct 8, 2024
1 parent 8b36ec7 commit 8e79f5c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 3 additions & 3 deletions spec/jobs/model_scan_job_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@
let(:thing) { create(:model, path: "thingiverse_model", library: library) }

it "scans files" do # rubocop:todo RSpec/MultipleExpectations
expect { described_class.perform_now(thing.id) }.to change { thing.model_files.count }.to(2)
expect(thing.model_files.map(&:filename)).to eq ["files/part_one.stl", "images/card_preview_DISPLAY.png"]
expect { described_class.perform_now(thing.id) }.to change { thing.model_files.count }.to(4)
expect(thing.model_files.map(&:filename)).to eq ["LICENSE.txt", "README.txt", "files/part_one.stl", "images/card_preview_DISPLAY.png"]
end

it "ignores model-type files in image directory" do # rubocop:todo RSpec/MultipleExpectations
expect { described_class.perform_now(thing.id) }.to change { thing.model_files.count }.to(2)
expect { described_class.perform_now(thing.id) }.to change { thing.model_files.count }.to(4)
expect(thing.model_files.map(&:filename)).not_to include "images/ignore.stl"
end
end
Expand Down
3 changes: 1 addition & 2 deletions spec/jobs/scan/detect_filesystem_changes_job_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@
around do |ex|
MockDirectory.create([
"thingiverse_model/files/part_one.stl",
"thingiverse_model/images/preview.stl",
"thingiverse_model/README.txt"
"thingiverse_model/images/preview.stl"
]) do |path|
@library_path = path
ex.run
Expand Down

0 comments on commit 8e79f5c

Please sign in to comment.