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
4 changes: 2 additions & 2 deletions lib/react/rails/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ class Railtie < ::Rails::Railtie
directory = app.config.react.variant == :production ? 'production' : 'development'
directory += '-with-addons' if app.config.react.addons

app.assets.append_path(root_path.join('lib/assets/react-source/').join(directory).to_s)
app.assets.append_path(root_path.join('lib/assets/javascripts/').to_s)
app.config.assets.paths << root_path.join('lib/assets/react-source/').join(directory).to_s
app.config.assets.paths << root_path.join('lib/assets/javascripts/').to_s
end

config.after_initialize do |app|
Expand Down
6 changes: 6 additions & 0 deletions test/react_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,10 @@ class ReactTest < ActionDispatch::IntegrationTest
assert_response :success
assert_equal react_file_token, @response.body
end

test 'precompiling assets works' do
Dummy::Application.load_tasks
Rake::Task['assets:precompile'].invoke
FileUtils.rm_r(File.expand_path("../dummy/public/assets", __FILE__))
end
end