Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

rake spec:javascript ran in the wrong rails environment #53

Closed
RobertAudi opened this issue Jul 13, 2013 · 6 comments
Closed

rake spec:javascript ran in the wrong rails environment #53

RobertAudi opened this issue Jul 13, 2013 · 6 comments

Comments

@RobertAudi
Copy link

This might be a special case but it's a issue nonetheless. The rake spec:javascript command runs the specs in the wrong environment; that is, not in the test environment. I am using SSL in my app, which I've disabled in the test environment and I redirect all non-HTTPS traffic to their HTTPS equivalent (again, disabled in the test environment). When I ran rake spec:javascript I got the following error:

Jasmine runner at '/specs' returned a 301 error: Moved Permanently

This error is logical in my case, but I think that the rake task should run in the test environment anyway.

I managed to avoid the error using the following command:

RAILS_ENV=test rake spec:javascript
@kpolitowicz
Copy link

+1

It caused a snowball of problems when I couldn't make jasmine-spec.js uncompressed no matter what I changed in config/environments/test.rb which prompted me to bug good people at angular/angular.js#3534

@tvdeyen
Copy link

tvdeyen commented Aug 20, 2013

+1 👍

@gkop
Copy link

gkop commented Sep 24, 2014

+1

@searls
Copy link
Member

searls commented Sep 24, 2014

We've run into a bunch of problems trying to force rails to set the test environment from the rake task. To my knowledge the only way to do it would be to shell out inside the task in the event it's set to any other mode. PRs welcome

@searls
Copy link
Member

searls commented Sep 24, 2014

I have an idea for a PR that would fix this problem. -- what if the rake task detected whether force_ssl was turned on and if so, specified "https" in the URL passed off to phantom?

@searls
Copy link
Member

searls commented Sep 19, 2015

@searls searls closed this as completed Sep 19, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants