Sha256: c6b8337b062f08dc79f149f6bdfbf4a9e3651f9630ccc3d89ab7a55d71f786c4
Contents?: true
Size: 1.22 KB
Versions: 16
Compression:
Stored size: 1.22 KB
Contents
require 'test_helper' module Adminpanel class SectionTest < ActiveSupport::TestCase def test_telephone_validations set_telephone assert @telephone.valid? @telephone.update_attribute(:description, '1' * 9) assert @telephone.invalid? @telephone.update_attribute(:description, '1' * 11) assert @telephone.invalid? @telephone.update_attribute(:description, '01-2-3-4-5') assert @telephone.invalid? @telephone.update_attribute(:description, '') assert @telephone.valid? end def test_default_scope assert_equal( Adminpanel::Section.all.to_sql, Adminpanel::Section.reorder('').order(:order => :asc).to_sql ) end protected def set_telephone @telephone = Adminpanel::Section.new( name: 'Telefono', key: 'phone', has_description: false, description: '1234567890', page: 'home', has_image: false ) end def set_description @description = Adminpanel::Section.new( name: 'Inicio', key: 'greeting', has_description: true, description: 'lorem ipsum dolor sit amec', page: 'home', has_image: false ) end end end
Version data entries
16 entries across 16 versions & 1 rubygems