Commit 84a218d7 authored by marcheing's avatar marcheing

Add relation between user and profile

parent adb4c557
class Profile < ApplicationRecord
belongs_to :user
validates :terms_of_service, acceptance: true
end
......@@ -6,4 +6,6 @@ class User < ApplicationRecord
:confirmable, :lockable, :timeoutable
validates :email, confirmation: true
has_one :profile
end
require 'rails_helper'
RSpec.describe Profile, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
describe 'associations' do
it { is_expected.to belong_to(:user) }
end
end
require 'rails_helper'
RSpec.describe User, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
describe 'associations' do
it { is_expected.to have_one(:profile) }
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment