Sha256: 3bb9fba4629ebf494dd3581a40b1d3425e76f8b9f0bb73839a2cf9d755b14e18
Contents?: true
Size: 1.05 KB
Versions: 6
Compression:
Stored size: 1.05 KB
Contents
require 'spec_helper' describe 'LadyJosephine::Renderer::SirTrevorRenderer' do it 'should return an empty string if the json is empty' do expect( LadyJosephine::Renderer::SirTrevorRenderer.new("{}").render_body ).to eql "" end it 'should return html if the json has a valid SirTrevor Document in it' do expect( LadyJosephine::Renderer::SirTrevorRenderer.new( "{\"server_uuid\":\"6cb3e116-fce1-4ae9-8e7f-d8007aec7542\",\"data\":[{\"type\":\"text\",\"data\":{\"note\":\"no\",\"uuid\":\"da0fb3fc-3c9b-42c5-a354-8fb21a29258a\",\"text\":\"This is Text\"}}]}" ).render_body ).to eql "<p class='cp lady-josephine-block--text' data-article_component='da0fb3fc-3c9b-42c5-a354-8fb21a29258a' ng-class=\"{'is-active': active}\" notes_count='0'>This is Text</p>\n" end it 'throws an expection if the document is damaged' do expect { LadyJosephine::Renderer::SirTrevorRenderer.new( "{\"server_uuid\":\"6cb3e116-fce1-4ae9-8e7f-d8007aec7542\"," ).render_body }.to raise_error JSON::ParserError end end
Version data entries
6 entries across 6 versions & 1 rubygems