spec/griddler/mailgun/adapter_spec.rb in griddler-mailgun-1.0.2 vs spec/griddler/mailgun/adapter_spec.rb in griddler-mailgun-1.0.3
- old
+ new
@@ -28,9 +28,18 @@
normalized_params = Griddler::Mailgun::Adapter.normalize_params(params)
expect(normalized_params[:attachments]).to eq [upload_1, upload_2]
end
+ it "receives attachments sent from store action" do
+ params = default_params.merge(
+ "attachments" => [{ url: "sample.url", name: "sample name" },
+ { url: "sample2.url", name: "sample name 2" }]
+ )
+ normalized_params = Griddler::Mailgun::Adapter.normalize_params(params)
+ expect(normalized_params[:attachments].length).to eq 2
+ end
+
it 'has no attachments' do
normalized_params = Griddler::Mailgun::Adapter.normalize_params(default_params)
expect(normalized_params[:attachments]).to be_empty
end