diff --git a/app/assets/javascripts/backbone/broadcasters/faye.js.coffee.erb b/app/assets/javascripts/backbone/broadcasters/faye.js.coffee.erb index 0872ab69..7f45e36e 100644 --- a/app/assets/javascripts/backbone/broadcasters/faye.js.coffee.erb +++ b/app/assets/javascripts/backbone/broadcasters/faye.js.coffee.erb @@ -1,7 +1,7 @@ class Kandan.Broadcasters.FayeBroadcaster constructor: ()-> - @fayeClient = new Faye.Client("<%= ENV['FULL_HOST'] %>/remote/faye") + @fayeClient = new Faye.Client("<%= ENV['KANDAN_FAYE_URL'] %>/remote/faye") @fayeClient.disable('websocket') authExtension = { diff --git a/app/assets/templates/chatbox.jst.eco b/app/assets/templates/chatbox.jst.eco index 31d38ac1..3dacc2c7 100644 --- a/app/assets/templates/chatbox.jst.eco +++ b/app/assets/templates/chatbox.jst.eco @@ -1,2 +1,2 @@ - + diff --git a/config/environments/test.rb b/config/environments/test.rb index 22e9cfcc..56dbeb90 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -36,6 +36,7 @@ config.active_support.deprecation = :stderr # Variable set to be able to get faye client for test environments - ENV['FULL_HOST'] = "http://localhost:9292" + ENV['KANDAN_FAYE_PORT'] = "9292" unless ENV['KANDAN_FAYE_PORT'] + ENV['KANDAN_FAYE_URL'] = "http://localhost:#{ENV['KANDAN_FAYE_PORT']}" unless ENV['KANDAN_FAYE_URL'] end diff --git a/lib/broadcasters/faye.rb b/lib/broadcasters/faye.rb index 2adf99a2..e75df70a 100644 --- a/lib/broadcasters/faye.rb +++ b/lib/broadcasters/faye.rb @@ -13,7 +13,7 @@ def broadcast(channel, message) end def assets - ["#{ENV['FULL_HOST']}/remote/faye.js"] + ["#{ENV['KANDAN_FAYE_URL']}/remote/faye.js"] end end end diff --git a/spec/features/login_spec.rb b/spec/features/login_spec.rb index 6420b5cf..6fd7a580 100644 --- a/spec/features/login_spec.rb +++ b/spec/features/login_spec.rb @@ -23,14 +23,16 @@ page.should have_content(@user.first_name) page.should have_content(@user.last_name) - fill_in "chat-input", :with => "Hello there" + expect(page).to have_css('.chat-input') + chat_input = find(:css, ".chat-input") + chat_input.set "Hello there" click_button "Post" within("#channel-activities-1") do page.should have_content("Hello there") end - fill_in "chat-input", :with => "Hi again" + chat_input.set "Hi again" click_button "Post" within("#channel-activities-1") do @@ -38,4 +40,4 @@ end end -end \ No newline at end of file +end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 10809b97..a3ff8695 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -34,7 +34,7 @@ ActiveUsers.remove_by_client_id(client_id) end -Thread.new {faye_server.listen(9292)} +Thread.new {faye_server.listen(ENV['KANDAN_FAYE_PORT'].to_i)} Capybara.app = Rack::URLMap.new({ "/" => Kandan::Application