jejacks0n / teaspoon

Teaspoon: Javascript test runner for Rails. Use Selenium, BrowserStack, or PhantomJS.
1.43k stars 243 forks source link

test running failed on circle: /teaspoon route not available on circleci #510

Closed phuongnd08 closed 7 years ago

phuongnd08 commented 7 years ago

Same Gemfile, same teaspoon_env.rb, on local machine, there is "/teaspoon" available. But on circleci, the path is not available.

phuongnd08 commented 7 years ago

We use a catch all routes in our app but I guess teaspoon is supposed to deal with it.

phuongnd08 commented 7 years ago

So ignore /teaspoon from the catchall route solve the issue for us. I guess this should be documented.

jacksonrayhamilton commented 5 years ago

Just ran into this myself — probably would be good to add to the docs or maybe even override (in Rails.env.development? andRails.env.test?` only).

Here was my solution in case the maintainer or other bug fixers stumble upon this comment:

I changed this:

get "/*path" => "home#index"

To this:

if Rails.env.development? || Rails.env.test?
  get "/*path" => "home#index", constraints: ->(req) { req.fullpath !~ %r{^/teaspoon} }
else
  get "/*path" => "home#index"
end