Sha256: 0b02c2e33575f23762ea7e7765346b6c406da40687ef04bea001c39ab78cdaf4
Contents?: true
Size: 1.05 KB
Versions: 62
Compression:
Stored size: 1.05 KB
Contents
require 'test_helper' module Workarea module Catalog class CategoryTest < TestCase include FeaturedProductsTest include NavigableTest def featured_product_model @featured_product_model ||= create_category end def navigable_class Category end def test_valid? category = Category.new(product_ids: ['', nil, '1234']) category.valid? assert_equal(['1234'], category.product_ids) end def test_unique_client_ids category_1 = create_category category_2 = create_category category_3 = create_category(client_id: nil) category_4 = create_category(client_id: nil) category_5 = create_category(client_id: 'test') category_6 = Category.new(client_id: 'test') assert_nil(category_1.client_id) assert_nil(category_2.client_id) assert_nil(category_3.client_id) assert_nil(category_4.client_id) assert_equal('test', category_5.client_id) refute(category_6.valid?) end end end end
Version data entries
62 entries across 62 versions & 1 rubygems