Sha256: f400d9fed02ebd567529bbdfca1ef89918d55a7a81b5ee346b5e7cedff38762d

Contents?: true

Size: 999 Bytes

Versions: 6

Compression:

Stored size: 999 Bytes

Contents

require 'test_helper'
module Adminpanel
  class GalleryTest < ActiveSupport::TestCase

    # set_fixture_class 'adminpanel/galleries' => Adminpanel::Gallery

    def test_moving_up_with_the_best_position
      gallery_1 = adminpanel_galleries(:one)
      gallery_1.move_to_better_position
      assert_equal 1, gallery_1.position
    end

    def test_moving_down_with_the_worst_position
      gallery_3 = adminpanel_galleries(:three)
      gallery_3.move_to_worst_position
      assert_equal 3, gallery_3.position
    end

    def test_moving_up_with_intermediate_position
      gallery_2 = adminpanel_galleries(:two)
      gallery_2.move_to_better_position
      assert_equal 1, gallery_2.position
    end

    def test_moving_down_with_intermediate_position
      gallery_2 = adminpanel_galleries(:two)
      gallery_2.move_to_worst_position
      assert_equal 3, gallery_2.position
    end

    def test_file_presence
      g = Adminpanel::Gallery.new
      assert_not g.save
    end

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
adminpanel-2.1.7 test/models/adminpanel/gallery_test.rb
adminpanel-2.1.6 test/models/adminpanel/gallery_test.rb
adminpanel-2.1.5 test/models/adminpanel/gallery_test.rb
adminpanel-2.1.3 test/models/adminpanel/gallery_test.rb
adminpanel-2.1.2 test/models/adminpanel/gallery_test.rb
adminpanel-2.1.1 test/models/adminpanel/gallery_test.rb