diff options
author | Rémy Coutable <remy@rymai.me> | 2016-08-09 23:47:29 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-08-13 01:06:12 +0300 |
commit | e021604454f1093b7d762b28eae36e30083f0053 (patch) | |
tree | 6f6377cb9d7a92838dae62a7e59e87b9699c2c98 /spec/services/slash_commands | |
parent | 39f7f63fe951ff861ad151125188e6cdd598b6ff (diff) |
Don't extract slash commands inside blockcode, blockquote or HTML tags
Improve slash command descriptions, support /due tomorrow
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'spec/services/slash_commands')
-rw-r--r-- | spec/services/slash_commands/interpret_service_spec.rb | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/spec/services/slash_commands/interpret_service_spec.rb b/spec/services/slash_commands/interpret_service_spec.rb index 66ebe091893..620687e3212 100644 --- a/spec/services/slash_commands/interpret_service_spec.rb +++ b/spec/services/slash_commands/interpret_service_spec.rb @@ -27,7 +27,7 @@ describe SlashCommands::InterpretService, services: true do :done, :subscribe, :unsubscribe, - :due_date, + :due_date, :due, :clear_due_date ]) end @@ -119,10 +119,10 @@ describe SlashCommands::InterpretService, services: true do end shared_examples 'todo command' do - it 'populates todo_event: "mark" if content contains /todo' do + it 'populates todo_event: "add" if content contains /todo' do changes = service.execute(content, issuable) - expect(changes).to eq(todo_event: 'mark') + expect(changes).to eq(todo_event: 'add') end end @@ -154,7 +154,7 @@ describe SlashCommands::InterpretService, services: true do it 'populates due_date: Date.new(2016, 8, 28) if content contains /due_date 2016-08-28' do changes = service.execute(content, issuable) - expect(changes).to eq(due_date: Date.new(2016, 8, 28)) + expect(changes).to eq(due_date: defined?(expected_date) ? expected_date : Date.new(2016, 8, 28)) end end @@ -369,6 +369,12 @@ describe SlashCommands::InterpretService, services: true do let(:issuable) { issue } end + it_behaves_like 'due_date command' do + let(:content) { '/due tomorrow' } + let(:issuable) { issue } + let(:expected_date) { Date.tomorrow } + end + it_behaves_like 'empty command' do let(:content) { '/due_date foo bar' } let(:issuable) { issue } |