forked from External/greenlight
start writing tests
This commit is contained in:
@ -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
|
||||
|
@ -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
|
||||
|
13
db/schema.rb
13
db/schema.rb
@ -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
|
||||
|
10
db/seeds.rb
10
db/seeds.rb
@ -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",
|
||||
)
|
Reference in New Issue
Block a user