forked from External/greenlight
		
	Merge pull request #545 from farhatahmad/v2.1.1
GRN2-xx: Fixed Rubocop and Rspec
This commit is contained in:
		@@ -22,7 +22,8 @@ class AdminsController < ApplicationController
 | 
			
		||||
  include Emailer
 | 
			
		||||
 | 
			
		||||
  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
 | 
			
		||||
  before_action :find_user, only: manage_users
 | 
			
		||||
 
 | 
			
		||||
@@ -84,7 +84,7 @@ describe RoomsController, type: :controller do
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    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
 | 
			
		||||
 | 
			
		||||
      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
 | 
			
		||||
      @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" }
 | 
			
		||||
      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
 | 
			
		||||
      expect do
 | 
			
		||||
        name = Faker::Pokemon.name
 | 
			
		||||
        name = Faker::Games::Pokemon.name
 | 
			
		||||
        post :create, params: { room: { name: name } }
 | 
			
		||||
      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
 | 
			
		||||
      @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 } }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -32,7 +32,7 @@ FactoryBot.define do
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  factory :room do
 | 
			
		||||
    name { Faker::Pokemon.name }
 | 
			
		||||
    name { Faker::Games::Pokemon.name }
 | 
			
		||||
    owner { create(:user) }
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user