GRN2-202: Create a room in which everyone joins as Moderator (Fixed #628) (#650)

* Room setting to allow anyone to start a room

* Update sample.env

* merge v2.2.1
This commit is contained in:
shawn-higgins1
2019-07-23 14:54:46 -04:00
committed by Jesus Federico
parent b23f94dfb5
commit d3a9ae32a9
7 changed files with 54 additions and 13 deletions

View File

@ -119,8 +119,8 @@ describe RoomsController, type: :controller do
@request.session[:user_id] = @owner.id
name = Faker::Games::Pokemon.name
room_params = { name: name, "client": "html5", "mute_on_join": "1" }
json_room_settings = "{\"muteOnStart\":true,\"joinViaHtml5\":true}"
room_params = { name: name, "client": "html5", "mute_on_join": "1", "anyone_can_start": "1" }
json_room_settings = "{\"muteOnStart\":true,\"joinViaHtml5\":true,\"anyoneCanStart\":true}"
post :create, params: { room: room_params }
@ -203,6 +203,20 @@ describe RoomsController, type: :controller do
expect(response).to render_template(:wait)
end
it "should join the room if the room has the anyone_can_start setting" do
allow_any_instance_of(BigBlueButton::BigBlueButtonApi).to receive(:is_meeting_running?).and_return(false)
room = Room.new(name: "test")
room.room_settings = "{\"muteOnStart\":false,\"joinViaHtml5\":false,\"anyoneCanStart\":true}"
room.owner = @owner
room.save
@request.session[:user_id] = @user.id
post :join, params: { room_uid: room, join_name: @user.name }
expect(response).to redirect_to(room.join_path(@user.name, { user_is_moderator: true }, @user.uid))
end
it "should render wait if the correct access code is supplied" do
allow_any_instance_of(BigBlueButton::BigBlueButtonApi).to receive(:is_meeting_running?).and_return(false)
@ -343,7 +357,8 @@ describe RoomsController, type: :controller do
@request.session[:user_id] = @user.id
room_params = { "client": "html5", "mute_on_join": "1", "name": @secondary_room.name }
formatted_room_params = "{\"muteOnStart\":true,\"joinViaHtml5\":true}" # JSON string format
formatted_room_params = "{\"muteOnStart\":true,\"joinViaHtml5\":true,\"anyoneCanStart\":false}"
# JSON string format
expect { post :update_settings, params: { room_uid: @secondary_room.uid, room: room_params } }
.to change { @secondary_room.reload.room_settings }