require "rails_helper"

RSpec.describe DropzoneHelper, type: :helper do
  describe "#dropzone_accepted_files_for" do
    it "accepts image files for appearance releases" do
      releasable = build(:appearance_release)
      expect(helper.dropzone_accepted_files_for(releasable)).to eq("image/*")
    end

    it "accepts image files for talent releases" do
      releasable = build(:talent_release)
      expect(helper.dropzone_accepted_files_for(releasable)).to eq("image/*")
    end

    it "accepts image files for location releases" do
      releasable = build(:location_release)
      expect(helper.dropzone_accepted_files_for(releasable)).to eq("image/*")
    end

    it "accepts image files for material releases" do
      releasable = build(:material_release)
      expect(helper.dropzone_accepted_files_for(releasable)).to eq("image/*")
    end

    it "accepts audio files for music releases" do
      releasable = build(:music_release)
      expect(helper.dropzone_accepted_files_for(releasable)).to eq("audio/*")
    end

    it "accepts any file for acquired media releases" do
      releasable = build(:acquired_media_release)
      expect(helper.dropzone_accepted_files_for(releasable)).to be_nil
    end
  end
end
