fix user factory

and test accordingly
This commit is contained in:
Torsten Ruger 2017-06-05 16:26:15 +03:00
parent d18a4ad098
commit cdd87bf56b
2 changed files with 7 additions and 7 deletions

View File

@ -2,16 +2,16 @@ FactoryGirl.define do
factory :user do
confirmed_at Time.now
name "Test User"
email "test@example.com"
sequence( :email) { |n| "user#{n}@test.com" }
password "please123"
street "WhereIlive 111"
city "CityOfTesters"
country "WhereIam"
trait :admin do
role 'admin'
end
factory :admin do
sequence( :email) { |n| "admin#{n}@test.com" }
role :admin
end
end
end

View File

@ -6,7 +6,7 @@ RSpec.describe ApplyMailer, type: :mailer do
it "renders the headers" do
expect(mail.subject).to match("submitted")
expect(mail.to).to eq(["test@example.com"])
expect(mail.to.first).to match(/user.*test.com/)
expect(mail.from).to eq(["admission@webdev.camp"])
end
@ -20,7 +20,7 @@ RSpec.describe ApplyMailer, type: :mailer do
it "renders the headers" do
expect(mail.subject).to match("cancelled")
expect(mail.to).to eq(["test@example.com"])
expect(mail.to.first).to match(/user.*test.com/)
expect(mail.bcc).to eq(["admission@webdev.camp"])
expect(mail.from).to eq(["admission@webdev.camp"])
end