|
|
@ -200,7 +200,7 @@ RSpec.describe PostStatusService, type: :service do
|
|
|
|
status = subject.call(
|
|
|
|
status = subject.call(
|
|
|
|
account,
|
|
|
|
account,
|
|
|
|
text: "test status update",
|
|
|
|
text: "test status update",
|
|
|
|
media_ids: [media.id],
|
|
|
|
media_ids: [media.id]
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
expect(media.reload.status).to eq status
|
|
|
|
expect(media.reload.status).to eq status
|
|
|
@ -213,7 +213,7 @@ RSpec.describe PostStatusService, type: :service do
|
|
|
|
status = subject.call(
|
|
|
|
status = subject.call(
|
|
|
|
account,
|
|
|
|
account,
|
|
|
|
text: "test status update",
|
|
|
|
text: "test status update",
|
|
|
|
media_ids: [media.id],
|
|
|
|
media_ids: [media.id]
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
expect(media.reload.status).to eq nil
|
|
|
|
expect(media.reload.status).to eq nil
|
|
|
@ -232,11 +232,11 @@ RSpec.describe PostStatusService, type: :service do
|
|
|
|
Fabricate(:media_attachment, account: account),
|
|
|
|
Fabricate(:media_attachment, account: account),
|
|
|
|
Fabricate(:media_attachment, account: account),
|
|
|
|
Fabricate(:media_attachment, account: account),
|
|
|
|
Fabricate(:media_attachment, account: account),
|
|
|
|
Fabricate(:media_attachment, account: account),
|
|
|
|
].map(&:id),
|
|
|
|
].map(&:id)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
end.to raise_error(
|
|
|
|
end.to raise_error(
|
|
|
|
Mastodon::ValidationError,
|
|
|
|
Mastodon::ValidationError,
|
|
|
|
I18n.t('media_attachments.validations.too_many'),
|
|
|
|
I18n.t('media_attachments.validations.too_many')
|
|
|
|
)
|
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
@ -254,11 +254,11 @@ RSpec.describe PostStatusService, type: :service do
|
|
|
|
media_ids: [
|
|
|
|
media_ids: [
|
|
|
|
video,
|
|
|
|
video,
|
|
|
|
image,
|
|
|
|
image,
|
|
|
|
].map(&:id),
|
|
|
|
].map(&:id)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
end.to raise_error(
|
|
|
|
end.to raise_error(
|
|
|
|
Mastodon::ValidationError,
|
|
|
|
Mastodon::ValidationError,
|
|
|
|
I18n.t('media_attachments.validations.images_and_video'),
|
|
|
|
I18n.t('media_attachments.validations.images_and_video')
|
|
|
|
)
|
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|