Skip to content

Commit 462f68b

Browse files
committed
rubocop
1 parent fa6b384 commit 462f68b

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

lib/nylas/utils/file_utils.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def self.build_form_request(request_body)
3636
file = File.open(attachment[:file_path], "rb")
3737
end
3838

39-
# Setting original filename and content type if available. See code rest-client#lib/restclient/payload.rb
39+
# Setting original filename and content type if available. See rest-client#lib/restclient/payload.rb
4040
filename = attachment[:filename] || attachment["filename"]
4141
file.define_singleton_method(:original_filename) { filename } if filename
4242

spec/nylas/utils/file_utils_spec.rb

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,12 @@
192192
let(:mock_file) { instance_double("file") }
193193

194194
it "returns form data when attachment size is greater than 3MB" do
195-
large_attachment = { size: 4 * 1024 * 1024, content: mock_file, filename: 'file.txt', content_type: 'text/plain' }
195+
large_attachment = {
196+
size: 4 * 1024 * 1024,
197+
content: mock_file,
198+
filename: "file.txt",
199+
content_type: "text/plain"
200+
}
196201
request_body = { attachments: [large_attachment] }
197202

198203
allow(mock_file).to receive(:read).and_return("file content")
@@ -202,8 +207,8 @@
202207

203208
expect(payload).to include("multipart" => true)
204209
expect(opened_files).to include(mock_file)
205-
expect(mock_file.original_filename).to eq('file.txt')
206-
expect(mock_file.content_type).to eq('text/plain')
210+
expect(mock_file.original_filename).to eq("file.txt")
211+
expect(mock_file.content_type).to eq("text/plain")
207212
end
208213

209214
it "returns json data when attachment size is less than 3MB" do

0 commit comments

Comments
 (0)