GRN2-118: Create a setting to require authentication to join a room (#541)

* Create a setting to require authentication to join a room

* Apply comments
This commit is contained in:
shawn-higgins1
2019-05-22 13:44:40 -04:00
committed by Jesus Federico
parent 996518eea7
commit 70acb9a7e1
11 changed files with 89 additions and 14 deletions

View File

@ -278,5 +278,22 @@ describe AdminsController, type: :controller do
expect(response).to redirect_to(admins_path)
end
end
context "POST #room_authentication" do
it "changes the room authentication required setting" do
allow(Rails.configuration).to receive(:loadbalanced_configuration).and_return(true)
allow_any_instance_of(User).to receive(:greenlight_account?).and_return(true)
@request.session[:user_id] = @admin.id
checked = true
post :room_authentication, params: { authenticationRequired: checked }
feature = Setting.find_by(provider: "provider1").features.find_by(name: "Room Authentication")
expect(feature[:value]).to eq(checked.to_s)
expect(response).to redirect_to(admins_path)
end
end
end
end