Post inline images when syndicating
This commit is contained in:
@@ -7,7 +7,7 @@ RSpec.describe Micropub::Commands::Posts::Syndicate do
|
||||
let(:settings) { double("settings", mastodon_server: "https://mastodon.example/@tester", blue_sky_url: "https://bluesky.app") }
|
||||
let(:mastodon_client) { double("Adamantium::Client::Mastodon") }
|
||||
let(:mastodon_syndicator) { Adamantium::Syndication::Mastodon.new(mastodon_client: mastodon_client) }
|
||||
let(:post) { {url: "example.com", syndicate_to: ["https://mastodon.example", "https://bsky.app"], category: []} }
|
||||
let(:post) { {url: "example.com", content: "<p>Some cool post <img src='https://picsum.photos/200' /> <img src='https://picsum.photos/100' /></p>", syndicate_to: ["https://mastodon.example", "https://bsky.app"], category: []} }
|
||||
let(:add_post_syndication_source) { spy(Micropub::Commands::Posts::AddSyndicationSource) }
|
||||
|
||||
subject {
|
||||
@@ -17,7 +17,9 @@ RSpec.describe Micropub::Commands::Posts::Syndicate do
|
||||
}
|
||||
|
||||
before do
|
||||
allow(mastodon_client).to receive(:create_post).with(post: post, media_ids: nil).and_return(Success("http://mastodon.example/post/123"))
|
||||
allow(mastodon_client).to receive(:upload_media).with(photo: {"alt" => "", "value" => "https://picsum.photos/100"}).and_return("123")
|
||||
allow(mastodon_client).to receive(:upload_media).with(photo: {"alt" => "", "value" => "https://picsum.photos/200"}).and_return("456")
|
||||
allow(mastodon_client).to receive(:create_post).with(post: post, media_ids: ["456", "123"]).and_return(Success("http://mastodon.example/post/123"))
|
||||
end
|
||||
|
||||
it "syndicates a post to Mastodon" do
|
||||
|
Reference in New Issue
Block a user