-
Notifications
You must be signed in to change notification settings - Fork 406
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow for front end tests with poltergeist #206
Allow for front end tests with poltergeist #206
Conversation
Fails the build: https://travis-ci.org/kandanapp/kandan/builds/5427817 |
Looks like poltergeist just needed a larger timeout in the Travis environment. Also, this is just a suggested route! No worries If you guys already had something in mind for the code. Don't want to step on anyone's toes. 😄 |
@oponder Someone is supposed to verify all of this later today. I'm expecting the PR to be accepted in a few hours. |
@@ -1,7 +1,13 @@ | |||
class Kandan.Broadcasters.FayeBroadcaster | |||
|
|||
constructor: ()-> | |||
<% if Rails.env == "test" %> | |||
@fayeClient = new Faye.Client("http://localhost:9292/remote/faye") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about adding an env variable on each of the .rb files on /config/environments?
test.rb -> ENV['HOST'] = "http://localhost:9292"
production.rb and development.rb -> ENV['HOST'] = ""
You can use "#{ENV["HOST"]}/remote/faye"
which will return the desired url for each host.
Anyways we will need this ENV variable for mailer eventually
@gabceb: That makes sense! What do you think about using ActionMailer::Base.default_url_options[:host] instead of ENV['host']? like in this commit https://github.com/oponder/kandan/commit/c592bef3eed289ccf0c06f0f443d89658de1070d |
That works too! 👍 |
Allow for front end tests with poltergeist
…ltergeist Allow for front end tests with poltergeist
Submitting this as a conversation starter for issue #149.
It adds poltergeist and capybara to allow testing of the frontend.
I had to do some judo with Faye to get it all running. I'm not very happy with the conditionals on Rails.env that I introduced, so if anyone has better ideas let me know!
Also includes a proof of concept test (spec/features/login_spec.rb). Which tests the login, as well as submitting of a couple of chat messages.