Sha256: 13bf8465082e9c34b28e4b43aaf2dc9dbc533ad3c6f2a8ccedd0074904e9f57a

Contents?: true

Size: 820 Bytes

Versions: 1

Compression:

Stored size: 820 Bytes

Contents

require_relative '../test_helper'


class JsonAttributeAccessTest < Skr::TestCase

    def teardown
        GlAccount.whitelisted_json_attributes = {}
        GlAccount.blacklisted_json_attributes = {:updated_at=>{}, :created_at=>{}}
        GlAccount.exported_associations = {}
    end

    def test_blacklisting
        assert Skr::GlAccount.json_attribute_is_allowed?(:name)
        assert Skr::GlAccount.json_attribute_is_allowed?('name')

        GlAccount.send :blacklist_json_attributes, :name
        refute Skr::GlAccount.json_attribute_is_allowed?('name')
    end

    def test_whitelisting

        refute Skr::GlAccount.json_attribute_is_allowed?('updated_at')
        GlAccount.send :whitelist_json_attributes, :updated_at
        assert Skr::GlAccount.json_attribute_is_allowed?('updated_at')
    end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
stockor-core-0.2 test/concerns/json_attribute_access_test.rb