5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-25 19:26:22 +00:00
panel/test/models/metadata_boolean_test.rb

75 lines
1.2 KiB
Ruby
Raw Normal View History

# frozen_string_literal: true
require 'test_helper'
class MetadataBooleanTest < ActiveSupport::TestCase
test 'son false por defecto' do
site = create :site
post = site.posts.build
assert_equal false, post.draft.value
site.destroy
end
test 'pueden ser 0' do
site = create :site
post = site.posts.build
post.draft.value = '0'
assert_equal false, post.draft.value
post.save
assert_equal false, post.draft.value
site.destroy
end
test 'pueden ser 1' do
site = create :site
post = site.posts.build
post.draft.value = '1'
assert_equal true, post.draft.value
post.save
assert_equal true, post.draft.value
site.destroy
end
test 'pueden ser false' do
site = create :site
post = site.posts.build
post.draft.value = false
assert_equal false, post.draft.value
post.save
assert_equal false, post.draft.value
site.destroy
end
test 'pueden ser true' do
site = create :site
post = site.posts.build
post.draft.value = true
assert_equal true, post.draft.value
post.save
assert_equal true, post.draft.value
site.destroy
end
end