summaryrefslogtreecommitdiff
path: root/spec/models
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-10-06 15:58:28 -0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-10-11 11:39:04 -0300
commit95a5cc9285a8583988ece697ebdb948730b5db55 (patch)
treee27fd2d1c13d5643d01852932160b6c4550bd9e1 /spec/models
parentfb5a4202062d07d2dbca544f4cfb475a65411716 (diff)
downloadgitlab-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.rb9
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