require 'spec_helper' describe LadyJosephine::Concerns::Model do it 'should return a default hash' do expect(Article.new.content_data_hash).to eql({"server_uuid" => nil}) end it 'should retun a hash for the string in content_data' do article = Article.create(content_data: "{\"one\":\"two\"}") expect(article.content_data_hash).to eq({'one' => 'two'}) end it 'should serialize the hash' do article = Article.new article.content_data_hash = {this: "is a hash"} expect(article.content_data).to eq "{\"this\":\"is a hash\"}" end it 'should whitelist the class' do expect(LadyJosephine::Whitelist.instance.is_whitelisted?(Article)).to be_truthy end end