Sha256: c9f8d1667673fcd7c345f2af0dc0d0e6291b9a6e478bf87c248c80934d157feb

Contents?: true

Size: 628 Bytes

Versions: 12

Compression:

Stored size: 628 Bytes

Contents

require 'test_helper'

class GalleryUnitTest < Minitest::Test
  def test_gallery_position
    #load fixtures
    skip
    Adminpanel::Gallery.delete_all
    Adminpanel::Gallery.new.save(validate: false)
    Adminpanel::Gallery.new.save(validate: false)
    Adminpanel::Gallery.new.save(validate: false)

    first_gallery = Adminpanel::Gallery.first
    second_gallery = Adminpanel::Gallery.second
    third_gallery = Adminpanel::Gallery.third

    second_gallery.move_to_better_position
    assert_equal 1, second_gallery.position
    assert_equal 2, first_gallery.position
    assert_equal 3, third_gallery.position
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
adminpanel-2.2.5 test/unit/gallery_unit_test.rb
adminpanel-2.2.4 test/unit/gallery_unit_test.rb
adminpanel-2.2.3 test/unit/gallery_unit_test.rb
adminpanel-2.2.2 test/unit/gallery_unit_test.rb
adminpanel-2.2.1 test/unit/gallery_unit_test.rb
adminpanel-2.2.0 test/unit/gallery_unit_test.rb
adminpanel-2.1.7 test/unit/gallery_unit_test.rb
adminpanel-2.1.6 test/unit/gallery_unit_test.rb
adminpanel-2.1.5 test/unit/gallery_unit_test.rb
adminpanel-2.1.3 test/unit/gallery_unit_test.rb
adminpanel-2.1.2 test/unit/gallery_unit_test.rb
adminpanel-2.1.1 test/unit/gallery_unit_test.rb