factories: cleanup Administrateur, Instructeur and Expert factories
This changes: - avoids relying on application code to create mock objects, - allows to build Administrateur or Instructeurs without saving them.
This commit is contained in:
parent
0ff95df221
commit
a2b91c8ec6
9 changed files with 17 additions and 16 deletions
|
@ -61,7 +61,7 @@ describe Manager::UsersController, type: :controller do
|
|||
context 'and the old account belongs to an instructeur, expert and administrateur' do
|
||||
let!(:instructeur) { create(:instructeur, user: user) }
|
||||
let!(:expert) { create(:expert, user: user) }
|
||||
let!(:administrateur) { create(:administrateur, user: user) }
|
||||
let!(:administrateur) { create(:administrateur, user: user, instructeur: instructeur) }
|
||||
|
||||
it 'transfers instructeur account' do
|
||||
subject
|
||||
|
|
|
@ -40,7 +40,7 @@ describe WebhookController, type: :controller do
|
|||
|
||||
context 'when there are an associated Instructeur and Administrateur' do
|
||||
let!(:instructeur) { create(:instructeur, user: user) }
|
||||
let!(:admin) { create(:administrateur, user: user) }
|
||||
let!(:admin) { create(:administrateur, user: user, instructeur: instructeur) }
|
||||
|
||||
it 'returns a link to the Instructeur profile in the Manager' do
|
||||
expect(payload).to have_key('html')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue