diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-08-22 17:50:41 +0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-08-29 22:04:28 +0300 |
commit | 4cccfc0f171944cd6f2ffaf49e48cf005dcf985e (patch) | |
tree | 1adc2b594dea43b8be009c7ff2c5d252872e0169 /spec/services/boards | |
parent | 68b3c8c2973a8fe1ee3f51091394acef2a25789d (diff) |
Fix issue boards leak private label names and descriptions
Diffstat (limited to 'spec/services/boards')
-rw-r--r-- | spec/services/boards/lists/create_service_spec.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/spec/services/boards/lists/create_service_spec.rb b/spec/services/boards/lists/create_service_spec.rb index 5e7e145065e..90764b86b16 100644 --- a/spec/services/boards/lists/create_service_spec.rb +++ b/spec/services/boards/lists/create_service_spec.rb @@ -5,7 +5,7 @@ describe Boards::Lists::CreateService, services: true do let(:project) { create(:project_with_board) } let(:board) { project.board } let(:user) { create(:user) } - let(:label) { create(:label, name: 'in-progress') } + let(:label) { create(:label, project: project, name: 'in-progress') } subject(:service) { described_class.new(project, user, label_id: label.id) } @@ -50,5 +50,14 @@ describe Boards::Lists::CreateService, services: true do expect(list2.reload.position).to eq 1 end end + + context 'when provided label does not belongs to the project' do + it 'raises an error' do + label = create(:label, name: 'in-development') + service = described_class.new(project, user, label_id: label.id) + + expect { service.execute }.to raise_error(ActiveRecord::RecordNotFound) + end + end end end |