require 'test_helper'

class PhotoTest < ActiveSupport::TestCase

  def test_presence_description
    photo=Photo.new({:description => "Johnny Depp drunk", 
                     :date_taken => "2005-09-01",
                     :actor_id => 10,
                     :content_type => 'image/jpg' })
    assert photo.valid?
  end
  
  def test_future_date_taken
    photo=Photo.new({:description => "Johnny Depp drunk", 
                     :date_taken => "2020-09-01",
                     :actor_id => 10,
                     :content_type => 'image/jpg' })
    assert !photo.valid?
  end
  
  def wrong_content_type
    photo=Photo.new({:description => "Johnny Depp drunk", 
                     :date_taken => "2009-09-01",
                     :actor_id => 10,
                     :content_type => 'text' })
    assert !photo.valid?
  end
  
end
