Skip to content

Commit

Permalink
add RSpec version of test for load increment on join
Browse files Browse the repository at this point in the history
  • Loading branch information
Ithanil committed Mar 27, 2024
1 parent a583113 commit 15adf4d
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions spec/requests/bigbluebutton_api_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1162,6 +1162,25 @@
expect(response).to redirect_to(encode_bbb_uri("join", server.url, server.secret, params).to_s)
end

it "increments the server load by the value of load_multiplier" do
server.load_multiplier = 7.0
server.save!
meeting = create(:meeting, server: server)

# Reload 1
new_server = Server.find(server.id)
load_before_join = new_server.load

# Join
params = { meetingID: meeting.id, password: "test-password", fullName: "test-name" }
get bigbluebutton_api_join_url, params: params

# Reload 2
new_server = Server.find(server.id)
expected_load = load_before_join + 7.0
expect(new_server.load).to eq(expected_load)
end

it "redirects user to the current join url with only permitted params for join" do
meeting = create(:meeting, server: server)
params = { meetingID: meeting.id, password: "test-password", fullName: "test-name", test1: "", test2: "" }
Expand Down

0 comments on commit 15adf4d

Please sign in to comment.