Sha256: d8a78929168b642d7803766954f1646be04b4ff2fff90a833ef82e6afe17c46b

Contents?: true

Size: 694 Bytes

Versions: 15

Compression:

Stored size: 694 Bytes

Contents

require 'test_helper'

class DropzoneElementGenerationTest < ViewCase
  fixtures :all

  setup :sign_in

  test "rendering the form should display the dropzone element" do
    visit adminpanel.new_product_path

    assert_selector '#photo_dropzone'
  end

  test "render the form should add a hidden input for each existing photos" do
    product = adminpanel_products(:first)
    visit adminpanel.edit_product_path(product)
    assert product.photos.count > 0
    assert_selector '#photo_dropzone'
    assert_selector "input[type='hidden'][name='product[photo_ids][]']", count: product.photos.count
  end

  protected
    def sign_in
      visit adminpanel.signin_path
      login
    end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
adminpanel-3.6.1 test/features/shared/ui/dropzone_element_generation_test.rb
adminpanel-3.6.0 test/features/shared/ui/dropzone_element_generation_test.rb
adminpanel-3.5.1 test/features/shared/ui/dropzone_element_generation_test.rb
adminpanel-3.5.0 test/features/shared/ui/dropzone_element_generation_test.rb
adminpanel-3.4.7 test/features/shared/ui/dropzone_element_generation_test.rb
adminpanel-3.4.6 test/features/shared/ui/dropzone_element_generation_test.rb
adminpanel-3.4.5 test/features/shared/ui/dropzone_element_generation_test.rb
adminpanel-3.4.4 test/features/shared/ui/dropzone_element_generation_test.rb
adminpanel-3.4.3 test/features/shared/ui/dropzone_element_generation_test.rb
adminpanel-3.4.2 test/features/shared/ui/dropzone_element_generation_test.rb
adminpanel-3.4.1 test/features/shared/ui/dropzone_element_generation_test.rb
adminpanel-3.4.0 test/features/shared/ui/dropzone_element_generation_test.rb
adminpanel-3.3.4 test/features/shared/ui/dropzone_element_generation_test.rb
adminpanel-3.3.3 test/features/shared/ui/dropzone_element_generation_test.rb
adminpanel-3.3.0 test/features/shared/ui/dropzone_element_generation_test.rb