Fixed #303 Add the ability to rename rooms and recordings (GRN-18) (#304)

* <Added modal for rename>

* <Commit changes and switch branch>

* <Javascript Scaffolding for rename room feature>

* <Created room_block.js>

* <update changes>

* <Updating rename branch>

* <Update rename.js>

* <Update branch>

* <Update branch>

* <Implemented renaming of room blocks>

* <Refactoring code>

* Remove modal due to new design

* <Finished renaming of rooms>

* <Updated renaming of recordings>

* <updating branch>

* <added renaming of recordings>

* <update branch>

* <>

* <Fixed code style>

* <Fixed rspec tests>

* Update application.js
This commit is contained in:
John Ma
2018-12-04 10:48:51 -05:00
committed by Jesus Federico
parent efa9e08dfc
commit 41a543f6b8
13 changed files with 285 additions and 9 deletions

View File

@ -18,6 +18,15 @@
require "rails_helper"
def random_valid_room_params
{
room: {
name: Faker::Name.first_name,
auto_join: false,
},
}
end
describe RoomsController, type: :controller do
describe "GET #show" do
before do
@ -186,4 +195,38 @@ describe RoomsController, type: :controller do
expect(response).to redirect_to(root_path)
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 }
expect(response).to redirect_to(@secondary_room)
end
end
end