Sha256: da28cdd526ea5bbd20d690f8b551973dcdf48552f3d8bad8058618e93b165dd2

Contents?: true

Size: 711 Bytes

Versions: 3

Compression:

Stored size: 711 Bytes

Contents

require File.dirname(__FILE__) + '/../../spec_helper'
require 'taskwarrior-web/command_builders/v1'
require 'taskwarrior-web/command'
require 'ostruct'

describe TaskwarriorWeb::CommandBuilder::V1 do
  describe '#substitute_parts' do
    before do
      TaskwarriorWeb::Command.class_eval do |class_name|
        include TaskwarriorWeb::CommandBuilder::V1
      end
      @command = TaskwarriorWeb::Command.new(:complete, 34588)
    end

    it 'should replace the :id string with the given task ID' do
      TaskwarriorWeb::Task.should_receive(:query).and_return([OpenStruct.new(:uuid => 34588)])
      @command.task_command.substitute_parts
      @command.command_string.should eq('1 done')
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
taskwarrior-web-1.0.3 spec/models/command_builders/v1_spec.rb
taskwarrior-web-1.0.2 spec/models/command_builders/v1_spec.rb
taskwarrior-web-1.0.1 spec/models/command_builders/v1_spec.rb