forked from External/greenlight
Added setting for admin to limit the number of rooms for the user (#607)
This commit is contained in:
committed by
Jesus Federico
parent
4f2b190239
commit
e4f50026f1
@ -247,7 +247,9 @@ describe AdminsController, type: :controller do
|
||||
expect(response).to redirect_to(admins_path)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "Site Settings" do
|
||||
context "POST #registration_method" do
|
||||
it "changes the registration method for the given context" do
|
||||
allow(Rails.configuration).to receive(:enable_email_verification).and_return(true)
|
||||
@ -294,5 +296,21 @@ describe AdminsController, type: :controller do
|
||||
expect(response).to redirect_to(admins_path)
|
||||
end
|
||||
end
|
||||
|
||||
context "POST #room_limit" do
|
||||
it "changes the room limit 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
|
||||
|
||||
post :room_limit, params: { limit: 5 }
|
||||
|
||||
feature = Setting.find_by(provider: "provider1").features.find_by(name: "Room Limit")
|
||||
|
||||
expect(feature[:value]).to eq("5")
|
||||
expect(response).to redirect_to(admins_path)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user