Skip to content

Commit

Permalink
Make sure the app connects to the test faye when it is in the test en…
Browse files Browse the repository at this point in the history
…vironment
  • Loading branch information
oponder committed Mar 12, 2013
1 parent 8c0ba3e commit 6c89ac3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
class Kandan.Broadcasters.FayeBroadcaster

constructor: ()->
<% if Rails.env == "test" %>
@fayeClient = new Faye.Client("http://localhost:9292/remote/faye")
@fayeClient.setHeader('Access-Control-Allow-Origin', '*');
<% else %>
@fayeClient = new Faye.Client("/remote/faye")
<% end %>

@fayeClient.disable('websocket')
authExtension = {
outgoing: (message, callback)->
Expand Down
6 changes: 5 additions & 1 deletion lib/broadcasters/faye.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ def broadcast(channel, message)
end

def assets
["/remote/faye.js"]
if Rails.env == "test"
["http://localhost:9292/remote/faye.js"]
else
['remote/faye']
end
end
end
end
Expand Down

0 comments on commit 6c89ac3

Please sign in to comment.