forked from External/greenlight
GRN2-196: Fixed issues that scrutinizer is complaining about (#765)
* Refactored code to improve scrutinizer score * Bug fixes
This commit is contained in:
@ -366,7 +366,7 @@ describe RoomsController, type: :controller do
|
||||
@request.session[:user_id] = @user.id
|
||||
post :start, params: { room_uid: @other_room }
|
||||
|
||||
expect(response).to redirect_to(@user.main_room)
|
||||
expect(response).to redirect_to(root_path)
|
||||
end
|
||||
|
||||
it "should bring to root if not authenticated" do
|
||||
@ -405,37 +405,11 @@ describe RoomsController, type: :controller do
|
||||
.from(@secondary_room.room_settings).to(formatted_room_params)
|
||||
expect(response).to redirect_to(@secondary_room)
|
||||
end
|
||||
end
|
||||
|
||||
describe "PATCH #update" do
|
||||
before do
|
||||
@user = create(:user)
|
||||
@secondary_room = create(:room, owner: @user)
|
||||
@editable_room = create(:room, owner: @user)
|
||||
end
|
||||
|
||||
it "properly updates room name through room block and redirects to current page" do
|
||||
@request.session[:user_id] = @user.id
|
||||
|
||||
patch :update, params: { room_uid: @secondary_room, room_block_uid: @editable_room,
|
||||
setting: :rename_block, room_name: :name }
|
||||
|
||||
expect(response).to redirect_to(@secondary_room)
|
||||
end
|
||||
|
||||
it "properly updates room name through room header and redirects to current page" do
|
||||
@request.session[:user_id] = @user.id
|
||||
|
||||
patch :update, params: { room_uid: @secondary_room, setting: :rename_header, room_name: :name }
|
||||
|
||||
expect(response).to redirect_to(@secondary_room)
|
||||
end
|
||||
|
||||
it "properly updates recording name and redirects to current page" do
|
||||
@request.session[:user_id] = @user.id
|
||||
|
||||
patch :update, params: { room_uid: @secondary_room, recordid: :recordid,
|
||||
setting: :rename_recording, record_name: :name }
|
||||
patch :update_settings, params: { room_uid: @secondary_room, setting: :rename_header, room_name: :name }
|
||||
|
||||
expect(response).to redirect_to(@secondary_room)
|
||||
end
|
||||
|
Reference in New Issue
Block a user