diff --git a/Dockerfile.dev b/Dockerfile.dev index bfb15d2073..554385cfea 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -1,10 +1,10 @@ -# Base stage with common dependencies -FROM alpine:3.17 AS base +FROM alpine:3.17 AS alpine ARG RAILS_ROOT=/usr/src/app ENV RAILS_ROOT=${RAILS_ROOT} -WORKDIR $RAILS_ROOT +FROM alpine AS base +WORKDIR $RAILS_ROOT RUN apk add --no-cache \ libpq \ libxml2 \ @@ -18,11 +18,7 @@ RUN apk add --no-cache \ bash \ shared-mime-info - - -# Builder stage for installing build dependencies -FROM base AS builder - +FROM base as builder RUN apk add --no-cache \ build-base \ curl-dev \ @@ -35,24 +31,17 @@ RUN apk add --no-cache \ nodejs \ yarn \ yaml-dev \ - zlib-dev - - - + zlib-dev \ + && ( echo 'install: --no-document' ; echo 'update: --no-document' ) >>/etc/gemrc COPY Gemfile* ./ - -RUN bundle lock --add-platform x86_64-linux-musl RUN bundle config build.nokogiri --use-system-libraries \ - && bundle config set --local deployment 'true' --without 'development test' \ - && bundle install -j4 \ + && bundle config set --local deployment 'true' without 'development:test' +RUN bundle install --deployment -j4 \ && yarn install - +RUN rm -rf vendor/bundle/ruby/*/cache COPY . ./ -# Final stage FROM base - -# Ensure development dependencies are installed RUN apk add --no-cache \ build-base \ curl-dev \ @@ -64,18 +53,23 @@ RUN apk add --no-cache \ nodejs \ yarn \ yaml-dev \ - zlib-dev - -COPY --from=builder $RAILS_ROOT $RAILS_ROOT -RUN chmod +x ./bin/start + zlib-dev \ + && ( echo 'install: --no-document' ; echo 'update: --no-document' ) >>/etc/gemrc +#USER greenlight:greenlight -# Set environment variables ARG RAILS_ENV -ENV RAILS_ENV=${RAILS_ENV:-development} +ENV RAILS_ENV=${RAILS_ENV:-production} ARG RAILS_LOG_TO_STDOUT ENV RAILS_LOG_TO_STDOUT=${RAILS_LOG_TO_STDOUT:-true} + ARG VERSION_CODE ENV VERSION_CODE=$VERSION_CODE +RUN pwd +COPY --from=builder $RAILS_ROOT $RAILS_ROOT +RUN ls -al + EXPOSE 3000 -CMD ["bash", "-c", "./bin/start"] \ No newline at end of file +CMD [ "./bin/start" ] +#ENTRYPOINT [ "./bin/start" ] + diff --git a/Procfile.dev b/Procfile.dev index b3a3bff10b..f52919f027 100644 --- a/Procfile.dev +++ b/Procfile.dev @@ -1,3 +1,3 @@ -web: ruby bin/rails server -p $PORT +web: bin/rails server -p $PORT js: yarn build:development -css: yarn build:development:css --watch \ No newline at end of file +css: yarn build:development:css --watch diff --git a/app/assets/locales/de.json b/app/assets/locales/de.json index d9fa2785fe..ca0e0d76ba 100644 --- a/app/assets/locales/de.json +++ b/app/assets/locales/de.json @@ -301,7 +301,7 @@ "default_role_description": "Standard-Rolle, die neuen Nutzer:innen zugeteilt wird", "registration_method": "Registrierungs-Methode", "registration_method_description": "Registrierungs-Methoden ändern", - "registration_methods": { + "registration_methods" : { "open": "Offene Registrierung", "invite": "Per Einladung teilnehmen", "approval": "Zulassen/Ablehnen" @@ -529,8 +529,8 @@ "room_join": { "fields": { "name": { - "label": "Name", - "placeholder": "Namen eingeben" + "label": "Name", + "placeholder": "Namen eingeben" }, "access_code": { "label": "Zugangscode", diff --git a/app/assets/locales/en.json b/app/assets/locales/en.json index afdd7cacc9..e8961418e2 100644 --- a/app/assets/locales/en.json +++ b/app/assets/locales/en.json @@ -304,7 +304,7 @@ "default_role_description": "The default role to be assigned to newly created users", "registration_method": "Registration Method", "registration_method_description": "Change the way that users register to the website", - "registration_methods": { + "registration_methods" : { "open": "Open Registration", "invite": "Join by Invitation", "approval": "Approve/Decline" @@ -534,8 +534,8 @@ "room_join": { "fields": { "name": { - "label": "Name", - "placeholder": "Enter your name" + "label": "Name", + "placeholder": "Enter your name" }, "access_code": { "label": "Access Code", diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 9cb854771a..69795c8d4c 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -39,7 +39,7 @@ def current_user # Returns whether hcaptcha is enabled by checking if ENV variables are set def hcaptcha_enabled? - ENV['HCAPTCHA_SITE_KEY'].present? && ENV['HCAPTCHA_SECRET_KEY'].present? + (ENV['HCAPTCHA_SITE_KEY'].present? && ENV['HCAPTCHA_SECRET_KEY'].present?) end # Returns the current provider value diff --git a/app/javascript/components/admin/manage_users/forms/UserSignupForm.jsx b/app/javascript/components/admin/manage_users/forms/UserSignupForm.jsx index f3bcfcb02a..810a2d31f4 100644 --- a/app/javascript/components/admin/manage_users/forms/UserSignupForm.jsx +++ b/app/javascript/components/admin/manage_users/forms/UserSignupForm.jsx @@ -36,14 +36,13 @@ export default function UserSignupForm({ handleClose }) { - diff --git a/app/models/recording.rb b/app/models/recording.rb index 2ad3181129..95b59ef658 100644 --- a/app/models/recording.rb +++ b/app/models/recording.rb @@ -46,7 +46,7 @@ def self.search(input) input: "%#{input}%").includes(:formats) end - includes(:formats) + all.includes(:formats) end def self.public_search(input) @@ -55,7 +55,7 @@ def self.public_search(input) input: "%#{input}%").includes(:formats) end - includes(:formats) + all.includes(:formats) end def self.server_search(input) @@ -68,7 +68,7 @@ def self.server_search(input) .includes(:formats) end - includes(:formats) + all.includes(:formats) end private diff --git a/app/models/role.rb b/app/models/role.rb index 2e2527eb96..14ba46fe6f 100644 --- a/app/models/role.rb +++ b/app/models/role.rb @@ -41,7 +41,7 @@ def self.search(input) def create_role_permissions return if %w[Administrator User Guest SuperAdmin].include? name # skip creation for default roles - Permission.find_each do |permission| + Permission.all.find_each do |permission| value = case permission.name when 'CreateRoom', 'SharedList', 'CanRecord' 'true' diff --git a/app/models/room.rb b/app/models/room.rb index 389b6a2e25..cad804f6a2 100644 --- a/app/models/room.rb +++ b/app/models/room.rb @@ -66,7 +66,7 @@ def get_setting(name:) def create_meeting_options configs = RoomsConfiguration.joins(:meeting_option).where(provider: user.provider).pluck(:name, :value).to_h - MeetingOption.find_each do |option| + MeetingOption.all.find_each do |option| value = if %w[true default_enabled].include? configs[option.name] option.true_value else @@ -103,10 +103,10 @@ def set_meeting_id # Create unique pin for voice brige max 10^5 - 10000 unique ids def set_voice_brige - unless Rails.application.config.voice_bridge_phone_number.nil? - id = SecureRandom.random_number(10.pow(5) - 1) - raise if Room.exists?(voice_bridge: id) || id < 10_000 - + if Rails.application.config.voice_bridge_phone_number != nil + id = SecureRandom.random_number((10.pow(5)) - 1) + raise if Room.exists?(voice_bridge: id) || id < 10000 + self.voice_bridge = id end rescue StandardError diff --git a/app/services/meeting_starter.rb b/app/services/meeting_starter.rb index e16edb23b0..b91884d50b 100644 --- a/app/services/meeting_starter.rb +++ b/app/services/meeting_starter.rb @@ -28,8 +28,7 @@ def initialize(room:, base_url:, current_user:, provider:) def call # TODO: amir - Check the legitimately of the action. - options = RoomSettingsGetter.new(room_id: @room.id, provider: @room.user.provider, current_user: @current_user, only_bbb_options: true, - voice_bridge: @room.voice_bridge).call + options = RoomSettingsGetter.new(room_id: @room.id, provider: @room.user.provider, current_user: @current_user, only_bbb_options: true, voice_bridge: @room.voice_bridge).call viewer_code = RoomSettingsGetter.new( room_id: @room.id, provider: @room.user.provider, diff --git a/app/services/room_settings_getter.rb b/app/services/room_settings_getter.rb index e57d28efaf..52b85666d0 100644 --- a/app/services/room_settings_getter.rb +++ b/app/services/room_settings_getter.rb @@ -103,8 +103,8 @@ def infer_can_record(room_settings:) end def set_voice_brige(room_settings:) - return if @voice_bridge.nil? - - room_settings['voiceBridge'] = @voice_bridge.to_s + if @voice_bridge != nil + room_settings['voiceBridge'] = "#{@voice_bridge}" + end end end diff --git a/bin/dev b/bin/dev index 5d2e6f00a5..0451e31cde 100755 --- a/bin/dev +++ b/bin/dev @@ -1,12 +1,13 @@ #!/usr/bin/env bash if [ -f .env ]; then - export $(echo $(cat .env | sed 's/#.*//g' | xargs) | envsubst) + export $(echo $(cat .env | sed 's/#.*//g'| xargs) | envsubst) fi export PORT="${PORT:=3000}" echo "Web app starting on port: $PORT" -if ! command -v foreman &>/dev/null; then +if ! command -v foreman &> /dev/null +then echo "Installing foreman..." gem install foreman fi diff --git a/bin/start b/bin/start index 2183a3844d..0952481fd7 100755 --- a/bin/start +++ b/bin/start @@ -11,19 +11,21 @@ echo "Redis host: $RDHOST" echo "Redis port: $RDPORT" if [ "$RAILS_ENV" = "production" ]; then - while ! nc -zw3 $PGHOST $PGPORT; do + while ! nc -zw3 $PGHOST $PGPORT + do echo "Waiting for postgres to start up ..." sleep 1 done - while ! nc -zw3 $RDHOST $RDPORT; do + while ! nc -zw3 $RDHOST $RDPORT + do echo "Waiting for redis to start up ..." sleep 1 done fi -./bin/rails assets:precompile -./bin/rails db:create -./bin/rails db:migrate:with_data +rails assets:precompile +rails db:create +rails db:migrate:with_data -exec ./bin/rails s -b 0.0.0.0 -p $PORT +exec rails s -b 0.0.0.0 -p $PORT diff --git a/config/initializers/content_security_policy.rb b/config/initializers/content_security_policy.rb index d048914913..2f9565fa5d 100644 --- a/config/initializers/content_security_policy.rb +++ b/config/initializers/content_security_policy.rb @@ -15,7 +15,6 @@ # with Greenlight; if not, see . # frozen_string_literal: true - # Be sure to restart your server when you modify this file. # Define an application-wide content security policy diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb index cad72f2cf5..78f5d8daca 100644 --- a/config/initializers/inflections.rb +++ b/config/initializers/inflections.rb @@ -15,7 +15,6 @@ # with Greenlight; if not, see . # frozen_string_literal: true - # Be sure to restart your server when you modify this file. # Add new inflection rules using the following format. Inflections diff --git a/config/initializers/permissions_policy.rb b/config/initializers/permissions_policy.rb index 3b7be158ac..0913944ac9 100644 --- a/config/initializers/permissions_policy.rb +++ b/config/initializers/permissions_policy.rb @@ -15,7 +15,6 @@ # with Greenlight; if not, see . # frozen_string_literal: true - # Define an application-wide HTTP permissions policy. For further # information see https://developers.google.com/web/updates/2018/06/feature-policy # diff --git a/config/locales/de.yml b/config/locales/de.yml index 68d3b62274..84132aab6b 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -80,4 +80,4 @@ de: link_expires: Der Link wird in 1 Stunde ungültig. ignore_request: "Wenn du dein Passwort nicht ändern wolltest, dann ignoriere bitte diese E-Mail." room: - new_room_name: "%{username}'s Raum" + new_room_name: "%{username}'s Raum" \ No newline at end of file diff --git a/db/data/20230328124724_populate_voice_brige_for_existing_rooms.rb b/db/data/20230328124724_populate_voice_brige_for_existing_rooms.rb index eb212d9585..e4af532014 100644 --- a/db/data/20230328124724_populate_voice_brige_for_existing_rooms.rb +++ b/db/data/20230328124724_populate_voice_brige_for_existing_rooms.rb @@ -2,20 +2,28 @@ class PopulateVoiceBrigeForExistingRooms < ActiveRecord::Migration[7.0] def up - return if Rails.application.config.voice_bridge_phone_number.nil? + if Rails.application.config.voice_bridge_phone_number == nil + return + end - raise 'The db contains to many rooms to assign each one a unique voice_bridge' if Room.all.length > 89_999 + if Room.all.length > 89999 + raise "The db contains to many rooms to assign each one a unique voice_bridge" + end - Room.where(voice_bridge: nil).find_each do |room| - id = SecureRandom.random_number(10.pow(5) - 1) + Room.where(voice_bridge: nil).each do |room| + id = SecureRandom.random_number((10.pow(5)) - 1) - id += 10_000 if id < 10_000 + if id < 10000 + id = id + 10000 + end while Room.exists?(voice_bridge: id) - id += 1 - id = 10_000 if id >= 99_999 + id = id + 1 + if id >= 99999 + id = 10000 + end end - + room.update(voice_bridge: id) end end diff --git a/db/data/20231030185844_lowercase_emails.rb b/db/data/20231030185844_lowercase_emails.rb index 89c0a40c09..fbe41a00bb 100644 --- a/db/data/20231030185844_lowercase_emails.rb +++ b/db/data/20231030185844_lowercase_emails.rb @@ -2,7 +2,7 @@ class LowercaseEmails < ActiveRecord::Migration[7.1] def up - User.find_each(batch_size: 250) do |user| + User.all.find_each(batch_size: 250) do |user| downcase = user.email.downcase next if user.email == downcase diff --git a/db/data/20231117151542_add_email_on_sign_up_permission.rb b/db/data/20231117151542_add_email_on_sign_up_permission.rb index 52a80d8ac4..d2bd13e1a4 100644 --- a/db/data/20231117151542_add_email_on_sign_up_permission.rb +++ b/db/data/20231117151542_add_email_on_sign_up_permission.rb @@ -23,7 +23,7 @@ def up values = [{ role: admin, permission: email_permission, value: 'true' }] - Role.where.not(name: 'Administrator').find_each do |role| + Role.where.not(name: 'Administrator').each do |role| values.push({ role:, permission: email_permission, value: 'false' }) end diff --git a/docker-compose.yml b/docker-compose.yml index 5768a0f5f1..89caf11cff 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,46 +1,35 @@ version: '3' -volumes: - postgres-data: - redis-data: - - services: - db: - image: postgres:14.8-alpine - container_name: db + postgres: + image: postgres:14.6-alpine3.17 + container_name: postgres restart: unless-stopped - ports: - - 5432:5432 volumes: - - postgres-data:/var/lib/postgresql/data + - ./data/postgres/14/database_data:/var/lib/postgresql/data environment: - POSTGRES_USER: postgres - POSTGRES_PASSWORD: postgres - PGDATA: /var/lib/postgresql/data - POSTGRES_HOST: db + - POSTGRES_USER=postgres + - POSTGRES_PASSWORD= redis: - image: redis:7.2.4-alpine + image: redis:6.2-alpine3.17 container_name: redis restart: unless-stopped volumes: - - redis-data:/data + - ./data/redis/database_data:/data - greenlight: - image: my-greenlight-dev - container_name: greenlight + greenlight-v3: + entrypoint: [bin/start] + image: bigbluebutton/greenlight:v3 + container_name: greenlight-v3 restart: unless-stopped + env_file: .env ports: - - "3000:3000" - - "587:587" - env_file: - - .env - depends_on: - - db - - redis + - 127.0.0.1:5050:3000 logging: - driver: "json-file" + driver: journald volumes: - - ./app/javascript:/usr/src/app/app/javascript - + - ./data/greenlight-v3/storage:/usr/src/app/storage + depends_on: + - postgres + - redis diff --git a/restart b/restart deleted file mode 100644 index c06eabde61..0000000000 --- a/restart +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -e - -docker-compose down -docker build -f Dockerfile.dev -t my-greenlight-dev . -docker-compose up -d diff --git a/sample.env b/sample.env index ff73aac250..8473431ec1 100644 --- a/sample.env +++ b/sample.env @@ -1,105 +1,100 @@ -# ## SECRET KEY BASE +### SECRET KEY BASE # Verifies the integrity of all secrets created in the application # Can be generated by running 'docker run --rm --entrypoint /bin/sh bigbluebutton/greenlight:v3 -c "bundle exec rails secret"' SECRET_KEY_BASE= -# ## BIGBLUEBUTTON CREDENTIALS +### BIGBLUEBUTTON CREDENTIALS # Set these if you are running GreenLight on a single BigBlueButton server. # You can retrieve these by running the following command on your BigBlueButton server: -# bbb-conf --secret +# bbb-conf --secret BIGBLUEBUTTON_ENDPOINT= BIGBLUEBUTTON_SECRET= -# ## POSTGRES DATABASE URL +### POSTGRES DATABASE URL # Must be in the format postgres://username:password@host:port/dbname -# E.g. postgres://postgres:password@postgres:5432/greenlight-v3-production +# E.g. postgres://postgres:password@postgres:5432/greenlight-v3-production DATABASE_URL= -# ## REDIS CACHE URL +### REDIS CACHE URL # Must be in the format redis://host:port -# E.g. redis://redis:6379 +# E.g. redis://redis:6379 REDIS_URL= -# ## OPTIONAL ENV VARS +### OPTIONAL ENV VARS -# ## SMTP CONFIGURATION +### SMTP CONFIGURATION # Emails are required for the basic features of Greenlight to function. # Please refer to your SMTP provider to get the values for the variables below # More information: https://docs.bigbluebutton.org/greenlight/v3/install/#email-setup -# SMTP_SENDER_EMAIL= -# SMTP_SENDER_NAME= -# SMTP_SERVER= -# SMTP_PORT= -# SMTP_DOMAIN= -# SMTP_USERNAME= -# SMTP_PASSWORD= -# SMTP_AUTH= -# SMTP_STARTTLS_AUTO=true -# SMTP_STARTTLS=false -# SMTP_TLS=false -# SMTP_SSL_VERIFY=true - -# ## EXTERNAL AUTHENTICATION METHODS +#SMTP_SENDER_EMAIL= +#SMTP_SENDER_NAME= +#SMTP_SERVER= +#SMTP_PORT= +#SMTP_DOMAIN= +#SMTP_USERNAME= +#SMTP_PASSWORD= +#SMTP_AUTH= +#SMTP_STARTTLS_AUTO=true +#SMTP_STARTTLS=false +#SMTP_TLS=false +#SMTP_SSL_VERIFY=true + +### EXTERNAL AUTHENTICATION METHODS # More information: https://docs.bigbluebutton.org/greenlight/v3/install/#openid-connect-setup -# OPENID_CONNECT_CLIENT_ID= -# OPENID_CONNECT_CLIENT_SECRET= -# OPENID_CONNECT_ISSUER= -# OPENID_CONNECT_REDIRECT= -# OPENID_CONNECT_UID_FIELD=sub +#OPENID_CONNECT_CLIENT_ID= +#OPENID_CONNECT_CLIENT_SECRET= +#OPENID_CONNECT_ISSUER= +#OPENID_CONNECT_REDIRECT= +#OPENID_CONNECT_UID_FIELD=sub # To enable hCaptcha on the user sign up and sign in, define these 2 keys # More information: https://docs.bigbluebutton.org/greenlight/v3/install/#hcaptcha-setup -# HCAPTCHA_SITE_KEY= -# HCAPTCHA_SECRET_KEY= +#HCAPTCHA_SITE_KEY= +#HCAPTCHA_SECRET_KEY= # Set these if you are using a Simple Storage Service (S3) # Uncomment S3_ENDPOINT only if you are using a S3 OTHER than Amazon Web Service (AWS) S3. -# S3_ACCESS_KEY_ID= -# S3_SECRET_ACCESS_KEY= -# S3_REGION= -# S3_BUCKET= -# S3_ENDPOINT= -# S3_FORCE_PATH_STYLE= +#S3_ACCESS_KEY_ID= +#S3_SECRET_ACCESS_KEY= +#S3_REGION= +#S3_BUCKET= +#S3_ENDPOINT= +#S3_FORCE_PATH_STYLE= # Set these environment variables if you are using Google Cloud Storage -# GCS_PROJECT= -# GCS_BUCKET= -# GCS_PROJECT_ID= -# GCS_PRIVATE_KEY_ID= -# GCS_PRIVATE_KEY= -# GCS_CLIENT_EMAIL= -# GCS_CLIENT_ID= -# GCS_CLIENT_CERT= +#GCS_PROJECT= +#GCS_BUCKET= +#GCS_PROJECT_ID= +#GCS_PRIVATE_KEY_ID= +#GCS_PRIVATE_KEY= +#GCS_CLIENT_EMAIL= +#GCS_CLIENT_ID= +#GCS_CLIENT_CERT= # Define the default locale language code (i.e. 'en' for English) from the following list: -# [en, ar, fr, es, fa_IR] +# [en, ar, fr, es, fa_IR] # The DEFAULT_LOCALE setting specifies the default language, overriding the browser language which is always set. # More information: https://docs.bigbluebutton.org/greenlight/v3/install/#default-locale-setup -# DEFAULT_LOCALE=en +#DEFAULT_LOCALE=en # Define the phone number for the voice bridge. # This number is not sent to bbb and is only displayed in the greenlight UI, but it should match the number in the bbb instance to avoid user confusion. -# If this number is defined, each newly created room will be assigned a static voiceBridge pin. -# VOICE_BRIDGE_PHONE_NUMBER= +# If this number is defined, each newly created room will be assigned a static voiceBridge pin. +#VOICE_BRIDGE_PHONE_NUMBER= # Set this if you like to deploy Greenlight on a relative root path other than / # More information: https://docs.bigbluebutton.org/greenlight/v3/install/#relative-url-root-path-subdirectory-setup -# RELATIVE_URL_ROOT=/gl +#RELATIVE_URL_ROOT=/gl -# # Define log level in production. +## Define log level in production. # [debug|info|warn|error|fatal] # Default 'warn'. LOG_LEVEL=info -# # Use to send logs to external repository (Optional) +## Use to send logs to external repository (Optional) # RAILS_LOG_REMOTE_NAME=xxx.papertrailapp.com # RAILS_LOG_REMOTE_PORT=99999 # RAILS_LOG_REMOTE_TAG=greenlight-v3 # Define weather HTML should be used inside ics files generated to share meetings over e-mail clients -# ICS_USE_HTML=true - -# # User block by inactivity -# If you want to block users after a certain period of inactivity, you can set the following environment variable. -# The value is in days. -USER_BLOCK_INACTIVITY=25 +#ICS_USE_HTML=true \ No newline at end of file diff --git a/spec/controllers/admin/server_rooms_controller_spec.rb b/spec/controllers/admin/server_rooms_controller_spec.rb index 4747d1c3cf..10b2de3a77 100644 --- a/spec/controllers/admin/server_rooms_controller_spec.rb +++ b/spec/controllers/admin/server_rooms_controller_spec.rb @@ -38,7 +38,7 @@ get :index expect(response.parsed_body['data'].pluck('friendly_id')) - .to match_array(Room.pluck(:friendly_id)) + .to match_array(Room.all.pluck(:friendly_id)) end context 'SuperAdmin accessing rooms for provider other than current provider' do @@ -57,7 +57,7 @@ get :index expect(response.parsed_body['data'].pluck('friendly_id')) - .to match_array(Room.pluck(:friendly_id)) + .to match_array(Room.all.pluck(:friendly_id)) end end diff --git a/spec/models/recording_spec.rb b/spec/models/recording_spec.rb index 7029135268..6f9b974523 100644 --- a/spec/models/recording_spec.rb +++ b/spec/models/recording_spec.rb @@ -74,7 +74,7 @@ it 'returns all recordings if input is empty' do create_list(:recording, 5) - expect(described_class.all.search('').pluck(:id)).to match_array(described_class.pluck(:id)) + expect(described_class.all.search('').pluck(:id)).to match_array(described_class.all.pluck(:id)) end end diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index b5a251fff1..9ce39bfc60 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -161,7 +161,7 @@ it 'returns all users if input is empty' do create_list(:user, 10) - expect(described_class.search('').pluck(:id)).to match_array(described_class.pluck(:id)) + expect(described_class.search('').pluck(:id)).to match_array(described_class.all.pluck(:id)) end end