Browse Source

Update spec

pull/114/head
baarkerlounger 4 years ago
parent
commit
568369d8e5
  1. 4
      spec/models/organisation_spec.rb
  2. 3
      spec/models/user_spec.rb

4
spec/models/organisation_spec.rb

@ -2,8 +2,8 @@ require "rails_helper"
RSpec.describe Organisation, type: :model do
describe "#new" do
let!(:user) { FactoryBot.create(:user) }
let(:organisation) { Organisation.first }
let(:user) { FactoryBot.create(:user) }
let(:organisation) { user.organisation }
it "has expected fields" do
expect(organisation.attribute_names).to include("name", "phone", "org_type")

3
spec/models/user_spec.rb

@ -3,10 +3,9 @@ require "rails_helper"
RSpec.describe User, type: :model do
describe "#new" do
let(:user) { FactoryBot.create(:user) }
let(:organisation) { Organisation.first }
it "belongs to an organisation" do
expect(user.organisation).to eq(organisation)
expect(user.organisation).to be_a(Organisation)
end
end
end

Loading…
Cancel
Save