diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-10-06 15:58:28 -0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-10-11 11:39:04 -0300 |
commit | 95a5cc9285a8583988ece697ebdb948730b5db55 (patch) | |
tree | e27fd2d1c13d5643d01852932160b6c4550bd9e1 /spec/models | |
parent | fb5a4202062d07d2dbca544f4cfb475a65411716 (diff) | |
download | gitlab-ce-95a5cc9285a8583988ece697ebdb948730b5db55.tar.gz |
Restrict the number of permitted boards per project to one
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/project_spec.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index 3748b1c7f5f..1b13f1be477 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -94,6 +94,15 @@ describe Project, models: true do end end end + + describe '#boards' do + it 'raises an error when attempting to add more than one board to the project' do + subject.boards.build + + expect { subject.boards.build }.to raise_error(StandardError, 'Number of permitted boards exceeded') + expect(subject.boards.size).to eq 1 + end + end end describe 'modules' do |