Skip to content

Commit

Permalink
Completed fix for the specs (#343)
Browse files Browse the repository at this point in the history
  • Loading branch information
jfederico committed Jan 18, 2019
1 parent 4d9d0eb commit 56a72ad
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
8 changes: 4 additions & 4 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,17 @@ class Application < Rails::Application
# The default callback url that bn launcher will redirect to
config.gl_callback_url = ENV["GL_CALLBACK_URL"]

# Default credentials (test-install.blindsidenetworks.com/bigbluebutton).
config.bigbluebutton_endpoint_default = "http://test-install.blindsidenetworks.com/bigbluebutton/api/"
config.bigbluebutton_secret_default = "8cd8ef52e8e101574e400365b55e11a6"

# Setup BigBlueButton configuration.
if config.loadbalanced_configuration
# Fetch credentials from a loadbalancer based on provider.
config.loadbalancer_endpoint = ENV["LOADBALANCER_ENDPOINT"]
config.loadbalancer_secret = ENV["LOADBALANCER_SECRET"]
config.launcher_secret = ENV["LAUNCHER_SECRET"]
else
# Default credentials (test-install.blindsidenetworks.com/bigbluebutton).
config.bigbluebutton_endpoint_default = "http://test-install.blindsidenetworks.com/bigbluebutton/api/"
config.bigbluebutton_secret_default = "8cd8ef52e8e101574e400365b55e11a6"

# Use standalone BigBlueButton server.
config.bigbluebutton_endpoint = ENV["BIGBLUEBUTTON_ENDPOINT"] || config.bigbluebutton_endpoint_default
config.bigbluebutton_secret = ENV["BIGBLUEBUTTON_SECRET"] || config.bigbluebutton_secret_default
Expand Down
10 changes: 7 additions & 3 deletions spec/models/room_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,13 @@
attendeePW: "testpass"
)

endpoint = Rails.configuration.bigbluebutton_endpoint
secret = Rails.configuration.bigbluebutton_secret
if Rails.configuration.loadbalanced_configuration
endpoint = Rails.configuration.loadbalancer_endpoint
secret = Rails.configuration.loadbalancer_secret
else
endpoint = Rails.configuration.bigbluebutton_endpoint
secret = Rails.configuration.bigbluebutton_secret
end
fullname = "fullName=Example"
meeting_id = "&meetingID=#{@room.bbb_id}"
password = "&password=testpass"
Expand All @@ -101,7 +106,6 @@
checksum_string = "join#{query + secret}"

checksum = OpenSSL::Digest.digest('sha1', checksum_string).unpack("H*").first

expect(@room.join_path("Example")).to eql("#{endpoint}join?#{query}&checksum=#{checksum}")
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@
<user>
<name>greenlight</name>
<maxMeetings>1000</maxMeetings>
<apiURL>#{ENV['LOADBALANCER_ENDPOINT'] + 'api'}</apiURL>
<secret>#{ENV['BIGBLUEBUTTON_SECRET']}</secret>
<apiURL>#{ENV['LOADBALANCER_ENDPOINT']}</apiURL>
<secret>#{ENV['LOADBALANCER_SECRET']}</secret>
</user>
</response>", headers: {}) if ENV['LOADBALANCER_ENDPOINT']
end
Expand Down

0 comments on commit 56a72ad

Please sign in to comment.