{"action":"created","issue":{"url":"https://api.github.com/repos/reactjs/react-rails/issues/439","labels_url":"https://api.github.com/repos/reactjs/react-rails/issues/439/labels{/name}","comments_url":"https://api.github.com/repos/reactjs/react-rails/issues/439/comments","events_url":"https://api.github.com/repos/reactjs/react-rails/issues/439/events","html_url":"https://github.com/reactjs/react-rails/issues/439","id":126415595,"number":439,"title":"react UJS not rendering components in tests","user":{"login":"georgemillo","id":2656485,"avatar_url":"https://avatars.githubusercontent.com/u/2656485?v=3","gravatar_id":"","url":"https://api.github.com/users/georgemillo","html_url":"https://github.com/georgemillo","followers_url":"https://api.github.com/users/georgemillo/followers","following_url":"https://api.github.com/users/georgemillo/following{/other_user}","gists_url":"https://api.github.com/users/georgemillo/gists{/gist_id}","starred_url":"https://api.github.com/users/georgemillo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/georgemillo/subscriptions","organizations_url":"https://api.github.com/users/georgemillo/orgs","repos_url":"https://api.github.com/users/georgemillo/repos","events_url":"https://api.github.com/users/georgemillo/events{/privacy}","received_events_url":"https://api.github.com/users/georgemillo/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-01-13T13:14:19Z","updated_at":"2016-01-13T17:41:19Z","closed_at":"2016-01-13T17:41:19Z","body":"When I output a component onto the page using `react_component` everything works fine when I test it manually, but my automated tests won't pass. I initially thought it might be a problem with Poltergeist or PhantomJS, but I switched to Selenium and the tests still fail. When I look at the browser window during a Selenium run, or when I call `save_screenshot` in Poltergeist, I can see that my components aren't being rendered at all; it's as if `ReactDOM.render` (or whatever the method is) never gets called. (But when I open up the gem code and add `console.log` statements inside e.g. `mountComponents` in `react_ujs.js.erb` or within the `render` functions of my own components, I can see that those methods *are* being called - they're just not doing anything.)\r\n\r\nI made a minimal app that recreates the problem [here](https://github.com/georgemillo/react-poltergeist-fail-example/blob/master/spec/features/example_spec.rb) - run the test in [spec/features/example_spec.rb](https://github.com/georgemillo/react-poltergeist-fail-example/blob/master/spec/features/example_spec.rb) and you can see it fails, but when you visit the tested page at `root_path` in the browser, you can see that the text *does* appear, i.e. the test should pass.\r\n\r\nAm I doing something wrong, or is this a bug?\r\n\r\nHere's the Gemfile.lock of that example app, if you're curious. Note that it's using Rails 5.0.0.beta1, and I'm testing all this with MRI Ruby 2.3.0p0.\r\n\r\n```\r\nGEM\r\n  remote: https://rubygems.org/\r\n  specs:\r\n    actioncable (5.0.0.beta1)\r\n      actionpack (= 5.0.0.beta1)\r\n      celluloid (~> 0.17.2)\r\n      coffee-rails (~> 4.1.0)\r\n      em-hiredis (~> 0.3.0)\r\n      faye-websocket (~> 0.10.0)\r\n      redis (~> 3.0)\r\n      websocket-driver (~> 0.6.1)\r\n    actionmailer (5.0.0.beta1)\r\n      actionpack (= 5.0.0.beta1)\r\n      actionview (= 5.0.0.beta1)\r\n      activejob (= 5.0.0.beta1)\r\n      mail (~> 2.5, >= 2.5.4)\r\n      rails-dom-testing (~> 1.0, >= 1.0.5)\r\n    actionpack (5.0.0.beta1)\r\n      actionview (= 5.0.0.beta1)\r\n      activesupport (= 5.0.0.beta1)\r\n      rack (~> 2.x)\r\n      rack-test (~> 0.6.3)\r\n      rails-dom-testing (~> 1.0, >= 1.0.5)\r\n      rails-html-sanitizer (~> 1.0, >= 1.0.2)\r\n    actionview (5.0.0.beta1)\r\n      activesupport (= 5.0.0.beta1)\r\n      builder (~> 3.1)\r\n      erubis (~> 2.7.0)\r\n      rails-dom-testing (~> 1.0, >= 1.0.5)\r\n      rails-html-sanitizer (~> 1.0, >= 1.0.2)\r\n    activejob (5.0.0.beta1)\r\n      activesupport (= 5.0.0.beta1)\r\n      globalid (>= 0.3.6)\r\n    activemodel (5.0.0.beta1)\r\n      activesupport (= 5.0.0.beta1)\r\n      builder (~> 3.1)\r\n    activerecord (5.0.0.beta1)\r\n      activemodel (= 5.0.0.beta1)\r\n      activesupport (= 5.0.0.beta1)\r\n      arel (~> 7.0)\r\n    activesupport (5.0.0.beta1)\r\n      concurrent-ruby (~> 1.0)\r\n      i18n (~> 0.7)\r\n      json (~> 1.7, >= 1.7.7)\r\n      method_source\r\n      minitest (~> 5.1)\r\n      tzinfo (~> 1.1)\r\n    arel (7.0.0)\r\n    babel-source (5.8.34)\r\n    babel-transpiler (0.7.0)\r\n      babel-source (>= 4.0, < 6)\r\n      execjs (~> 2.0)\r\n    builder (3.2.2)\r\n    byebug (8.2.1)\r\n    capybara (2.5.0)\r\n      mime-types (>= 1.16)\r\n      nokogiri (>= 1.3.3)\r\n      rack (>= 1.0.0)\r\n      rack-test (>= 0.5.4)\r\n      xpath (~> 2.0)\r\n    celluloid (0.17.2)\r\n      celluloid-essentials\r\n      celluloid-extras\r\n      celluloid-fsm\r\n      celluloid-pool\r\n      celluloid-supervision\r\n      timers (>= 4.1.1)\r\n    celluloid-essentials (0.20.5)\r\n      timers (>= 4.1.1)\r\n    celluloid-extras (0.20.5)\r\n      timers (>= 4.1.1)\r\n    celluloid-fsm (0.20.5)\r\n      timers (>= 4.1.1)\r\n    celluloid-pool (0.20.5)\r\n      timers (>= 4.1.1)\r\n    celluloid-supervision (0.20.5)\r\n      timers (>= 4.1.1)\r\n    cliver (0.3.2)\r\n    coffee-rails (4.1.1)\r\n      coffee-script (>= 2.2.0)\r\n      railties (>= 4.0.0, < 5.1.x)\r\n    coffee-script (2.4.1)\r\n      coffee-script-source\r\n      execjs\r\n    coffee-script-source (1.10.0)\r\n    concurrent-ruby (1.0.0)\r\n    connection_pool (2.2.0)\r\n    diff-lcs (1.2.5)\r\n    em-hiredis (0.3.0)\r\n      eventmachine (~> 1.0)\r\n      hiredis (~> 0.5.0)\r\n    erubis (2.7.0)\r\n    eventmachine (1.0.8)\r\n    execjs (2.6.0)\r\n    faye-websocket (0.10.2)\r\n      eventmachine (>= 0.12.0)\r\n      websocket-driver (>= 0.5.1)\r\n    globalid (0.3.6)\r\n      activesupport (>= 4.1.0)\r\n    hiredis (0.5.2)\r\n    hitimes (1.2.3)\r\n    i18n (0.7.0)\r\n    jquery-rails (4.0.5)\r\n      rails-dom-testing (~> 1.0)\r\n      railties (>= 4.2.0)\r\n      thor (>= 0.14, < 2.0)\r\n    json (1.8.3)\r\n    loofah (2.0.3)\r\n      nokogiri (>= 1.5.9)\r\n    mail (2.6.3)\r\n      mime-types (>= 1.16, < 3)\r\n    method_source (0.8.2)\r\n    mime-types (2.99)\r\n    mini_portile2 (2.0.0)\r\n    minitest (5.8.3)\r\n    multi_json (1.11.2)\r\n    nokogiri (1.6.7.1)\r\n      mini_portile2 (~> 2.0.0.rc2)\r\n    poltergeist (1.8.1)\r\n      capybara (~> 2.1)\r\n      cliver (~> 0.3.1)\r\n      multi_json (~> 1.0)\r\n      websocket-driver (>= 0.2.0)\r\n    puma (2.15.3)\r\n    rack (2.0.0.alpha)\r\n      json\r\n    rack-test (0.6.3)\r\n      rack (>= 1.0)\r\n    rails (5.0.0.beta1)\r\n      actioncable (= 5.0.0.beta1)\r\n      actionmailer (= 5.0.0.beta1)\r\n      actionpack (= 5.0.0.beta1)\r\n      actionview (= 5.0.0.beta1)\r\n      activejob (= 5.0.0.beta1)\r\n      activemodel (= 5.0.0.beta1)\r\n      activerecord (= 5.0.0.beta1)\r\n      activesupport (= 5.0.0.beta1)\r\n      bundler (>= 1.3.0, < 2.0)\r\n      railties (= 5.0.0.beta1)\r\n      sprockets-rails (>= 2.0.0)\r\n    rails-deprecated_sanitizer (1.0.3)\r\n      activesupport (>= 4.2.0.alpha)\r\n    rails-dom-testing (1.0.7)\r\n      activesupport (>= 4.2.0.beta, < 5.0)\r\n      nokogiri (~> 1.6.0)\r\n      rails-deprecated_sanitizer (>= 1.0.1)\r\n    rails-html-sanitizer (1.0.2)\r\n      loofah (~> 2.0)\r\n    railties (5.0.0.beta1)\r\n      actionpack (= 5.0.0.beta1)\r\n      activesupport (= 5.0.0.beta1)\r\n      method_source\r\n      rake (>= 0.8.7)\r\n      thor (>= 0.18.1, < 2.0)\r\n    rake (10.4.2)\r\n    react-rails (1.5.0)\r\n      babel-transpiler (>= 0.7.0)\r\n      coffee-script-source (~> 1.8)\r\n      connection_pool\r\n      execjs\r\n      rails (>= 3.2)\r\n      tilt\r\n    redis (3.2.2)\r\n    rspec-core (3.1.7)\r\n      rspec-support (~> 3.1.0)\r\n    rspec-expectations (3.1.2)\r\n      diff-lcs (>= 1.2.0, < 2.0)\r\n      rspec-support (~> 3.1.0)\r\n    rspec-mocks (3.1.3)\r\n      rspec-support (~> 3.1.0)\r\n    rspec-rails (3.1.0)\r\n      actionpack (>= 3.0)\r\n      activesupport (>= 3.0)\r\n      railties (>= 3.0)\r\n      rspec-core (~> 3.1.0)\r\n      rspec-expectations (~> 3.1.0)\r\n      rspec-mocks (~> 3.1.0)\r\n      rspec-support (~> 3.1.0)\r\n    rspec-support (3.1.2)\r\n    sprockets (3.5.2)\r\n      concurrent-ruby (~> 1.0)\r\n      rack (> 1, < 3)\r\n    sprockets-rails (3.0.0)\r\n      actionpack (>= 4.0)\r\n      activesupport (>= 4.0)\r\n      sprockets (>= 3.0.0)\r\n    sqlite3 (1.3.11)\r\n    thor (0.19.1)\r\n    thread_safe (0.3.5)\r\n    tilt (2.0.2)\r\n    timers (4.1.1)\r\n      hitimes\r\n    tzinfo (1.2.2)\r\n      thread_safe (~> 0.1)\r\n    uglifier (2.7.2)\r\n      execjs (>= 0.3.0)\r\n      json (>= 1.8.0)\r\n    websocket-driver (0.6.3)\r\n      websocket-extensions (>= 0.1.0)\r\n    websocket-extensions (0.1.2)\r\n    xpath (2.0.0)\r\n      nokogiri (~> 1.3)\r\n\r\nPLATFORMS\r\n  ruby\r\n\r\nDEPENDENCIES\r\n  byebug\r\n  capybara\r\n  jquery-rails\r\n  poltergeist\r\n  puma\r\n  rails (>= 5.0.0.beta1, < 5.1)\r\n  react-rails\r\n  rspec-rails\r\n  sqlite3\r\n  tzinfo-data\r\n  uglifier (>= 1.3.0)\r\n\r\nBUNDLED WITH\r\n   1.10.6\r\n```"},"comment":{"url":"https://api.github.com/repos/reactjs/react-rails/issues/comments/171375598","html_url":"https://github.com/reactjs/react-rails/issues/439#issuecomment-171375598","issue_url":"https://api.github.com/repos/reactjs/react-rails/issues/439","id":171375598,"user":{"login":"georgemillo","id":2656485,"avatar_url":"https://avatars.githubusercontent.com/u/2656485?v=3","gravatar_id":"","url":"https://api.github.com/users/georgemillo","html_url":"https://github.com/georgemillo","followers_url":"https://api.github.com/users/georgemillo/followers","following_url":"https://api.github.com/users/georgemillo/following{/other_user}","gists_url":"https://api.github.com/users/georgemillo/gists{/gist_id}","starred_url":"https://api.github.com/users/georgemillo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/georgemillo/subscriptions","organizations_url":"https://api.github.com/users/georgemillo/orgs","repos_url":"https://api.github.com/users/georgemillo/repos","events_url":"https://api.github.com/users/georgemillo/events{/privacy}","received_events_url":"https://api.github.com/users/georgemillo/received_events","type":"User","site_admin":false},"created_at":"2016-01-13T17:41:19Z","updated_at":"2016-01-13T17:41:19Z","body":"Urgh... I'm an idiot. Turns out the problem was with the way I'd configured my JS tests and nothing to do with react-rails. Apologies."}}