Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Rake::TestTask.new(:test) do |t|
t.libs << 'test'
t.pattern = ENV['TEST_PATTERN'] || 'test/**/*_test.rb'
t.verbose = ENV['TEST_VERBOSE'] == '1'
t.warning = true
end

task default: :test
2 changes: 1 addition & 1 deletion test/dummy/config/boot.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__)

require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
$LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__)
8 changes: 4 additions & 4 deletions test/react_renderer_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ class ReactRendererTest < ActiveSupport::TestCase

test 'Server rendering class directly' do
result = React::Renderer.render "TodoList", :todos => %w{todo1 todo2 todo3}
assert_match /todo1.*todo2.*todo3/, result
assert_match /data-react-checksum/, result
assert_match(/todo1.*todo2.*todo3/, result)
assert_match(/data-react-checksum/, result)
end

test 'Server rendering with an already-encoded json string' do
Expand All @@ -14,8 +14,8 @@ class ReactRendererTest < ActiveSupport::TestCase
end.target!

result = React::Renderer.render "TodoList", json_string
assert_match /todo1.*todo2.*todo3/, result
assert_match /data-react-checksum/, result
assert_match(/todo1.*todo2.*todo3/, result)
assert_match(/data-react-checksum/, result)
end

test 'Rendering does not throw an exception when console log api is used' do
Expand Down
10 changes: 5 additions & 5 deletions test/view_helper_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,14 @@ class ViewHelperTest < ActionDispatch::IntegrationTest

test 'react server rendering also gets mounted on client' do
visit '/server/1'
assert_match /data-react-class=\"TodoList\"/, page.html
assert_match /data-react-checksum/, page.html
assert_match /yep/, page.find("#status").text
assert_match(/data-react-class=\"TodoList\"/, page.html)
assert_match(/data-react-checksum/, page.html)
assert_match(/yep/, page.find("#status").text)
end

test 'react server rendering does not include internal properties' do
visit '/server/1'
assert_no_match /tag=/, page.html
assert_no_match /prerender=/, page.html
assert_no_match(/tag=/, page.html)
assert_no_match(/prerender=/, page.html)
end
end