Merge pull request #545 from farhatahmad/v2.1.1

GRN2-xx: Fixed Rubocop and Rspec
This commit is contained in:
farhatahmad 2019-05-22 13:52:39 -04:00 committed by GitHub
commit f7fef926f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 7 deletions

View File

@ -22,7 +22,8 @@ class AdminsController < ApplicationController
include Emailer include Emailer
manage_users = [:edit_user, :promote, :demote, :ban_user, :unban_user, :approve] manage_users = [:edit_user, :promote, :demote, :ban_user, :unban_user, :approve]
site_settings = [:branding, :coloring, :coloring_lighten, :coloring_darken, :registration_method, :room_authentication] site_settings = [:branding, :coloring, :coloring_lighten, :coloring_darken,
:registration_method, :room_authentication]
authorize_resource class: false authorize_resource class: false
before_action :find_user, only: manage_users before_action :find_user, only: manage_users

View File

@ -84,7 +84,7 @@ describe RoomsController, type: :controller do
end end
it "sets the join name to cookie[:greenlight_name] if it exists" do it "sets the join name to cookie[:greenlight_name] if it exists" do
name = Faker::Pokemon.name name = Faker::Games::Pokemon.name
@request.cookies[:greenlight_name] = name @request.cookies[:greenlight_name] = name
get :show, params: { room_uid: @owner.main_room } get :show, params: { room_uid: @owner.main_room }
@ -115,7 +115,7 @@ describe RoomsController, type: :controller do
it "should create room with name and correct settings" do it "should create room with name and correct settings" do
@request.session[:user_id] = @owner.id @request.session[:user_id] = @owner.id
name = Faker::Pokemon.name name = Faker::Games::Pokemon.name
room_params = { name: name, "client": "html5", "mute_on_join": "1" } room_params = { name: name, "client": "html5", "mute_on_join": "1" }
json_room_settings = "{\"muteOnStart\":true,\"joinViaHtml5\":true}" json_room_settings = "{\"muteOnStart\":true,\"joinViaHtml5\":true}"
@ -131,7 +131,7 @@ describe RoomsController, type: :controller do
it "it should redirect to root if not logged in" do it "it should redirect to root if not logged in" do
expect do expect do
name = Faker::Pokemon.name name = Faker::Games::Pokemon.name
post :create, params: { room: { name: name } } post :create, params: { room: { name: name } }
end.to change { Room.count }.by(0) end.to change { Room.count }.by(0)
@ -288,7 +288,7 @@ describe RoomsController, type: :controller do
it "properly updates room name through the room settings modal and redirects to current page" do it "properly updates room name through the room settings modal and redirects to current page" do
@request.session[:user_id] = @user.id @request.session[:user_id] = @user.id
name = Faker::Pokemon.name name = Faker::Games::Pokemon.name
room_params = { room_uid: @secondary_room.uid, room: { "name": name } } room_params = { room_uid: @secondary_room.uid, room: { "name": name } }

View File

@ -32,7 +32,7 @@ FactoryBot.define do
end end
factory :room do factory :room do
name { Faker::Pokemon.name } name { Faker::Games::Pokemon.name }
owner { create(:user) } owner { create(:user) }
end end
end end