GRN2-269: Pulling room settings using GET instead of data-attributes (#953)

* GRN2-269: Pulling room settings using GET instead of data-attributes

* GRN2-269: added test case and fixed documentation

* GRN2:269: rubocop fix

* GRN2-269: Fixed test case
This commit is contained in:
etiennevvv
2020-02-21 09:20:22 -05:00
committed by GitHub
parent c75c624a1a
commit 92da1f6f87
5 changed files with 36 additions and 9 deletions

View File

@ -180,6 +180,20 @@ describe RoomsController, type: :controller do
expect(response).to redirect_to(r)
end
it "should respond with JSON object of the room_settings" do
@request.session[:user_id] = @owner.id
@owner.main_room.update_attribute(:room_settings, { "muteOnStart": true, "requireModeratorApproval": true,
"anyoneCanStart": true, "joinModerator": true }.to_json)
json_room_settings = "{\"muteOnStart\":true,\"requireModeratorApproval\":true," \
"\"anyoneCanStart\":true,\"joinModerator\":true}"
get :room_settings, params: { room_uid: @owner.main_room }, format: :json
expect(JSON.parse(response.body)).to eql(json_room_settings)
end
it "should redirect to root if not logged in" do
expect do
name = Faker::Games::Pokemon.name