Sha256: 80c2b7b5430fe4567ea605a4f0e287d28d00b5d1c0e5fd3a9f3ddd44bed0db04

Contents?: true

Size: 856 Bytes

Versions: 1

Compression:

Stored size: 856 Bytes

Contents

require_relative '../../spec_helper'
require_relative '../../make_db'
require 'wlog/domain/attachment'
require 'wlog/domain/log_entry'
require 'wlog/domain/issue'
require 'wlog/commands/new_entry'

include Wlog

describe NewEntry do

  db_name = 'default'
  db_path = standard_db_path(db_name)

  before(:all) do
    make_testing_db(db_name)
    @issue = Issue.new
    @issue.description = 'my issue'
    @issue.save
  end

  after(:all) do
    FileUtils.rm db_path
  end

  it "should insert a new entry on execution" do
    command = NewEntry.new("my desc", @issue)
    command.execute
    expect(LogEntry.count).to eq(1)
  end

  it "should create 5 more inserts on 5 more executions" do
    previous = LogEntry.count
    command = NewEntry.new("my desc", @issue)
    5.times{ command.execute }
    expect(LogEntry.count).to eq(5 + previous)
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
wlog-1.2.2 spec/domain/commands/new_entry_spec.rb