From 32dcf8cabb7b871ae2afb86c96d2da373ff0b99b Mon Sep 17 00:00:00 2001 From: Lukas Matt Date: Thu, 13 Nov 2014 11:43:56 +0100 Subject: [PATCH] Test jsxc helper spec; should respond with correct url --- spec/helpers/jsxc_helper_spec.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 spec/helpers/jsxc_helper_spec.rb diff --git a/spec/helpers/jsxc_helper_spec.rb b/spec/helpers/jsxc_helper_spec.rb new file mode 100644 index 000000000..014e2f0b6 --- /dev/null +++ b/spec/helpers/jsxc_helper_spec.rb @@ -0,0 +1,21 @@ +require 'spec_helper' + +describe JsxcHelper, :type => :helper do + before do + AppConfig.chat.server.bosh.proxy = false + AppConfig.chat.server.bosh.port = 1234 + AppConfig.chat.server.bosh.bind = '/bind' + AppConfig.environment.url = "https://localhost/" + end + + describe "#get_bosh_endpoint" do + it "using http scheme and default values" do + expect(helper.get_bosh_endpoint).to include %Q(http://localhost:1234/bind) + end + + it "using https scheme and no port" do + AppConfig.chat.server.bosh.proxy = true + expect(helper.get_bosh_endpoint).to include %Q(https://localhost/bind) + end + end +end