Sha256: 1567708692cedc219513075ae9b1a2a422d42d1ff5ddc9e960c0f89d10bb3324

Contents?: true

Size: 597 Bytes

Versions: 30

Compression:

Stored size: 597 Bytes

Contents

require 'test_helper'

class PictureTest < ActiveSupport::TestCase

  test 'validity of factory' do
    create :picture
    assert_equal 1, Picture.count
  end

  test "attaching picture to a product" do
    product = create :product
    assert_difference 'product.pictures(true).size' do
      file = File.expand_path('../../fixtures/files/avatar.png', __FILE__)
      product.attach_picture('avatar.png', file)
    end
  end

  test 'deleting product should not delete picture' do
    product = create :product
    assert_no_difference 'Picture.count' do
      product.destroy
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
nimbleshop_core-0.0.23 test/unit/picture_test.rb
nimbleshop_core-0.0.21 test/unit/picture_test.rb
nimbleshop_core-0.0.20 test/unit/picture_test.rb
nimbleshop_core-0.0.19 test/unit/picture_test.rb
nimbleshop_core-0.0.17 test/unit/picture_test.rb
nimbleshop_core-0.0.16 test/unit/picture_test.rb
nimbleshop_core-0.0.15 test/unit/picture_test.rb
nimbleshop_core-0.0.14 test/unit/picture_test.rb
nimbleshop_core-0.0.14.rc2 test/unit/picture_test.rb
nimbleshop_core-0.0.14.rc1 test/unit/picture_test.rb
nimbleshop_core-0.0.13 test/unit/picture_test.rb
nimbleshop_core-0.0.12 test/unit/picture_test.rb
nimbleshop_core-0.0.11 test/unit/picture_test.rb
nimbleshop_core-0.0.10 test/unit/picture_test.rb
nimbleshop_core-0.0.9 test/unit/picture_test.rb
nimbleshop_core-0.0.8 test/unit/picture_test.rb
nimbleshop_core-0.0.7 test/unit/picture_test.rb
nimbleshop_core-0.0.5 test/unit/picture_test.rb
nimbleshop_core-0.0.4.beta1 test/unit/picture_test.rb
nimbleshop_core-0.0.4 test/unit/picture_test.rb