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