require 'test_helper'

class MovieTest < ActiveSupport::TestCase
  # Replace this with your real tests.
  test "the truth" do
    assert true
  end
  
  def test_presence_title
    movie=Movie.new({:title => "Gone with the wind", :length => "02:10" })
    assert movie.valid?
  end 
  
  def test_movie_length_bad1
    movie=Movie.new({:title => "Any title", :length => "abc"})
    # Test none numeric
    assert !movie.valid? 
  end  
  
  def test_movie_length_bad2
    movie=Movie.new({:title => "Any title", :length => "01:77"})
    # Test none numeric
    assert !movie.valid? 
  end
  
  def test_movie_length_good
    movie=Movie.new({:title => "Any title", :length => "04:30"})
    # Test none numeric
    assert movie.valid? 
  end  
  
end
