start writing tests

This commit is contained in:
Josh
2018-05-09 16:31:52 -04:00
parent e6d01ef1b9
commit 5347d902c0
24 changed files with 370 additions and 192 deletions

View File

@ -1,11 +1,12 @@
class CreateUsers < ActiveRecord::Migration[5.0]
def change
create_table :users do |t|
t.string :provider, null: false
t.string :uid, null: false
t.string :provider
t.string :uid
t.string :name
t.string :username
t.string :email
t.string :password_digest, index: { unique: true }
t.timestamps
end

View File

@ -2,7 +2,7 @@ class CreateMeetings < ActiveRecord::Migration[5.0]
def change
create_table :meetings do |t|
t.belongs_to :room, index: true
t.string :name, null: false
t.string :name, index: true
t.string :uid, index: true
t.timestamps

View File

@ -14,10 +14,11 @@ ActiveRecord::Schema.define(version: 20180504131713) do
create_table "meetings", force: :cascade do |t|
t.integer "room_id"
t.string "name", null: false
t.string "name"
t.string "uid"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["name"], name: "index_meetings_on_name"
t.index ["room_id"], name: "index_meetings_on_room_id"
t.index ["uid"], name: "index_meetings_on_uid"
end
@ -32,13 +33,15 @@ ActiveRecord::Schema.define(version: 20180504131713) do
end
create_table "users", force: :cascade do |t|
t.string "provider", null: false
t.string "uid", null: false
t.string "provider"
t.string "uid"
t.string "name"
t.string "username"
t.string "email"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "password_digest"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["password_digest"], name: "index_users_on_password_digest", unique: true
end
end

View File

@ -5,3 +5,13 @@
#
# movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
# Character.create(name: 'Luke', movie: movies.first)
User.create(
provider: "greenlight",
name: "Test User",
uid: "someuid",
username: "testuser",
email: "test@user.com",
password: "test",
password_confirmation: "test",
)