Sha256: d12bb6ca21cf978c197d3bd285b07837ef705a46e186387534bba6c7609b4a93

Contents?: true

Size: 766 Bytes

Versions: 1

Compression:

Stored size: 766 Bytes

Contents

require File.expand_path('../test_helper', File.dirname(__FILE__))

class SlideTest < ActiveSupport::TestCase
  
  def test_fixtures_validity
    Carousel::Slide.all.each do |slide|
      assert slide.valid?, slide.errors.inspect
    end
  end
  
  def test_validations
    slide = Carousel::Slide.new
    assert slide.invalid?
    assert_has_errors_on slide, [:carousel_id, :label]
  end
  
  def test_creation
    assert_difference 'Carousel::Slide.count' do
      slide = carousel_carousels(:default).slides.create(
        :label    => 'Test',
        :content  => 'Test Content',
        :url      => 'http://google.com',
        :file     => fixture_file_upload('files/image.jpg', 'image/jpeg')
      )
      assert_equal 1, slide.position
    end
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
comfy_carousel-0.0.1 test/unit/slide_test.rb