diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-11-07 15:33:42 +0300 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-11-07 18:27:55 +0300 |
commit | c85a19f920da1b544bbfae344145503c25e71048 (patch) | |
tree | 8acaf8e1b6cac9e71dbf545e8cf1443d03931280 /spec/services/quick_actions | |
parent | 6fbdc5ed5224154b89cf351e11a8f9db48e6d7f0 (diff) |
Allow limiting quick actions to execute
Sometimes we don't want to trigger any quick actions that cause side
effects. For example when building a record to validate. This allows
listing the quick actions that need to be performed.
Diffstat (limited to 'spec/services/quick_actions')
-rw-r--r-- | spec/services/quick_actions/interpret_service_spec.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/services/quick_actions/interpret_service_spec.rb b/spec/services/quick_actions/interpret_service_spec.rb index e513ee7ae44..5a7cafcb60f 100644 --- a/spec/services/quick_actions/interpret_service_spec.rb +++ b/spec/services/quick_actions/interpret_service_spec.rb @@ -1213,6 +1213,15 @@ describe QuickActions::InterpretService do end end end + + it 'limits to commands passed ' do + content = "/shrug\n/close" + + text, commands = service.execute(content, issue, only: [:shrug]) + + expect(commands).to be_empty + expect(text).to eq("#{described_class::SHRUG}\n/close") + end end describe '#explain' do |