Modified:
trunk/app/models/photo_receiver.rb
trunk/test/unit/photo_receiver_test.rb
Log:
Update to make sure score is inputted.
Modified: trunk/app/models/photo_receiver.rb
==============================================================================
--- trunk/app/models/photo_receiver.rb (original)
+++ trunk/app/models/photo_receiver.rb Fri Dec 7 20:38:12 2007
@@ -4,7 +4,6 @@
class PhotoReceiver < ActionMailer::Base
# email is a TMail::Mail
def receive(email)
- puts email.from[0]
# Iterate through parts of the email.
email.parts.each_with_index do |part, index|
if part.content_type =~ /^image/
@@ -14,7 +13,8 @@
:content_type => part.content_type.chomp,
:data => part.body,
:status => 'PENDING',
- :date => Date.today
+ :date => Date.today,
+ :score => 0
)
elsif part.content_type =~ /text\/html/
@@ -28,7 +28,8 @@
:content_type => p.content_type.chomp,
:data => p.read,
:status => 'PENDING',
- :date => Date.today
+ :date => Date.today,
+ :score => 0
)
end
end
Modified: trunk/test/unit/photo_receiver_test.rb
==============================================================================
--- trunk/test/unit/photo_receiver_test.rb (original)
+++ trunk/test/unit/photo_receiver_test.rb Fri Dec 7 20:38:12 2007
@@ -18,7 +18,7 @@
end
def test_photo_receiver
- puts "Testing hello-world.mail"
+ puts "Testing message with attachment."
email_text = read_fixture('hello-world.mail').join
PhotoReceiver.receive(email_text)
puts "Testing Sprint Picture Mail."