Always create a default study group for new consumers

This commit is contained in:
Sebastian Serth
2022-09-20 16:21:49 +02:00
committed by Sebastian Serth
parent 521626275f
commit cb1b163b30
3 changed files with 20 additions and 1 deletions

View File

@ -4,6 +4,7 @@ require 'rails_helper'
describe Consumer do
let(:consumer) { described_class.create }
let(:valid_consumer) { create(:consumer) }
it 'validates the presence of a name' do
expect(consumer.errors[:name]).to be_present
@ -21,4 +22,8 @@ describe Consumer do
it 'validates the presence of an OAuth secret' do
expect(consumer.errors[:oauth_secret]).to be_present
end
it 'creates a study group after creation' do
expect(valid_consumer.study_groups.count).to eq 1
end
end