rework tests

This commit is contained in:
Josh
2018-06-15 14:41:07 -04:00
parent 8cffc4872c
commit 086a39ca3d
35 changed files with 96 additions and 594 deletions

View File

@ -13,7 +13,7 @@ class User < ApplicationRecord
uniqueness: { case_sensitive: false },
format: {with: /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i }
validates :password, length: { minimum: 6 }, presence: true, confirmation: true, if: :greenlight_account?
validates :password, length: { minimum: 6 }, presence: true, confirmation: true, allow_blank: true, if: :greenlight_account?
# We don't want to require password validations on all accounts.
has_secure_password(validations: false)
@ -97,7 +97,7 @@ class User < ApplicationRecord
# Initializes a room for the user and assign a BigBlueButton user id.
def initialize_main_room
self.uid = "gl-#{(0...12).map { (65 + rand(26)).chr }.join.downcase}"
self.uid = "gl-#{(0...12).map { (65 + rand(26)).chr }.join.downcase}"
self.main_room = Room.create!(owner: self, name: firstname + "'s Room")
self.save
end