Skip to content
This repository has been archived by the owner on Oct 19, 2018. It is now read-only.

Commit

Permalink
added new spec files
Browse files Browse the repository at this point in the history
  • Loading branch information
catmando committed May 4, 2018
1 parent 8147c1f commit 57828c3
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
19 changes: 19 additions & 0 deletions react_prerendering_src.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
( (function () {
if (typeof console !== "undefined" && console.history) {
console.history = [];
}

var result = this.ReactRailsUJS.serverRender('renderToString', 'React.TopLevelRailsComponent', {"render_params":{},"component_name":"TestComponent77","controller":"ReactTest"});
(function (history) {
if (history && history.length > 0) {
result += '\n<scr'+'ipt class="react-rails-console-replay">';
history.forEach(function (msg) {
result += '\nconsole.' + msg.level + '.apply(console, ' + JSON.stringify(msg.arguments) + ');';
});
result += '\n</scr'+'ipt>';
}
})(console.history);

return result;
})()
)
4 changes: 4 additions & 0 deletions spec/test_app/app/assets/javascripts/server_rendering.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
//= require 'react-server'
//= require 'react_ujs'
//= require 'components'
Opal.load('components')

0 comments on commit 57828c3

Please sign in to comment.