Upload media to mastodon
This commit is contained in:
@@ -12,11 +12,11 @@ RSpec.describe Adamantium::Commands::Media::Upload do
|
||||
}
|
||||
|
||||
result = subject.call(file: file)
|
||||
expected_path = "media/#{Time.now.strftime("%m-%Y")}/foo.txt"
|
||||
expected_path = /media\/#{Time.now.strftime("%m-%Y")}\/[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}.txt/
|
||||
expect(result).to be_success
|
||||
expect(result.value!).to eq "http://localhost/#{expected_path}"
|
||||
File.read("public/#{expected_path}")
|
||||
File.delete("public/#{expected_path}")
|
||||
expect(result.value!).to match expected_path
|
||||
File.read("public/#{result.value!.gsub("http://localhost/", "")}")
|
||||
File.delete("public/#{result.value!.gsub("http://localhost/", "")}")
|
||||
end
|
||||
|
||||
it "returns a Failure if the file couldn't be saved" do
|
||||
|
Reference in New Issue
Block a user