Skip to content

Commit

Permalink
dont send attachments until multipart issue is solved
Browse files Browse the repository at this point in the history
  • Loading branch information
technoweenie committed Dec 10, 2008
1 parent 8023e69 commit ae5ec96
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
6 changes: 3 additions & 3 deletions app/models/mapping/http_post.rb
Expand Up @@ -10,9 +10,9 @@ def process
def post_fields
@post_fields ||= begin
fields = {:subject => @message.subject, :to => @message.recipient(@mapping.recipient_header_order), :from => @message.sender, :body => @message.body}
@message.attachments.each_with_index do |att, index|
fields[:"attachments_#{index}"] = att
end
# @message.attachments.each_with_index do |att, index|
# fields[:"attachments_#{index}"] = att
# end
fields
end
end
Expand Down
9 changes: 6 additions & 3 deletions app/models/message.rb
Expand Up @@ -103,14 +103,17 @@ def filename
end

# For IO API compatibility when used with Rest-Client
def close
end

alias path filename

def read(value = nil)
if read?
data
@is_read = true
else
nil
else
@is_read = true
data
end
end

Expand Down
1 change: 1 addition & 0 deletions spec/models/transport_spec.rb
Expand Up @@ -22,6 +22,7 @@
end

it "adds attachments to #post_fields" do
pending "multipart issue not solved yet"
@multipart = Message.parse(mail(:multipart))
@trans = Mapping::HttpPost.new(@multipart, @mapping)
@trans.post_fields.should == {:subject => @multipart.subject, :from => @multipart.sender, :to => @multipart.recipient, :body => @multipart.body, :attachments_0 => @multipart.attachments.first}
Expand Down

0 comments on commit ae5ec96

Please sign in to comment.