Sha256: a7e44af0b0fce4a3c0f33ba0512858461d96708ab2e2b2bc07d1d5b41f52c82a

Contents?: true

Size: 618 Bytes

Versions: 8

Compression:

Stored size: 618 Bytes

Contents

require "spec_helper"

if opal?

RSpec.describe React::Server do
  after(:each) do
    React::API.clear_component_class_cache
  end

  describe "render_to_string" do
    it "should render a React.Element to string" do
      ele = React.create_element('span') { "lorem" }
      expect(React::Server.render_to_string(ele)).to be_kind_of(String)
    end
  end

  describe "render_to_static_markup" do
    it "should render a React.Element to static markup" do
      ele = React.create_element('span') { "lorem" }
      expect(React::Server.render_to_static_markup(ele)).to eq("<span>lorem</span>")
    end
  end
end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
hyper-react-0.12.7 spec/react/server_spec.rb
hyper-react-0.12.6 spec/react/server_spec.rb
hyper-react-0.12.5 spec/react/server_spec.rb
hyper-react-0.12.4 spec/react/server_spec.rb
hyper-react-0.12.3 spec/react/server_spec.rb
hyper-react-0.12.2 spec/react/server_spec.rb
hyper-react-0.12.1 spec/react/server_spec.rb
hyper-react-0.12.0 spec/react/server_spec.rb