Sha256: edea54c81f96953ddf596285df3234083152846ca85f7864d84669afbf921586

Contents?: true

Size: 1.05 KB

Versions: 19

Compression:

Stored size: 1.05 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe "OpenallTimeApplet" do
  it "should be able to start" do
    $tmp_path = "/tmp/openall_spec.sqlite3"
    File.unlink($tmp_path) if File.exists?($tmp_path)
    Openall_time_applet::CONFIG[:db_path] = $tmp_path
    $oata = Openall_time_applet.new
  end
  
  it "should only return a specific amount of timelogs for tray-icon" do
    task1 = $oata.ob.add(:Task, :title => "Task 1")
    task2 = $oata.ob.add(:Task, :title => "Task 2")
    
    tlog1 = $oata.ob.add(:Timelog, :descr => "Tlog 1", :task_id => task1.id)
    tlog2 = $oata.ob.add(:Timelog, :descr => "Tlog 1", :task_id => task1.id)
    tlog3 = $oata.ob.add(:Timelog, :descr => "Tlog 1", :task_id => task2.id)
    tlog4 = $oata.ob.add(:Timelog, :descr => "Tlog 4", :task_id => task2.id)
    
    count = 0
    $oata.trayicon_timelogs do |timelog|
      count += 1
    end
    
    raise "Expected count 3 but got #{count}." if count != 3
  end
  
  it "should remove the temp db" do
    File.unlink($tmp_path) if File.exists?($tmp_path)
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
openall_time_applet-0.0.45 spec/tray_timelogs_spec.rb
openall_time_applet-0.0.44 spec/tray_timelogs_spec.rb
openall_time_applet-0.0.43 spec/tray_timelogs_spec.rb
openall_time_applet-0.0.42 spec/tray_timelogs_spec.rb
openall_time_applet-0.0.41 spec/tray_timelogs_spec.rb
openall_time_applet-0.0.40 spec/tray_timelogs_spec.rb
openall_time_applet-0.0.38 spec/tray_timelogs_spec.rb
openall_time_applet-0.0.37 spec/tray_timelogs_spec.rb
openall_time_applet-0.0.36 spec/tray_timelogs_spec.rb
openall_time_applet-0.0.35 spec/tray_timelogs_spec.rb
openall_time_applet-0.0.34 spec/tray_timelogs_spec.rb
openall_time_applet-0.0.33 spec/tray_timelogs_spec.rb
openall_time_applet-0.0.32 spec/tray_timelogs_spec.rb
openall_time_applet-0.0.31 spec/tray_timelogs_spec.rb
openall_time_applet-0.0.30 spec/tray_timelogs_spec.rb
openall_time_applet-0.0.29 spec/tray_timelogs_spec.rb
openall_time_applet-0.0.28 spec/tray_timelogs_spec.rb
openall_time_applet-0.0.27 spec/tray_timelogs_spec.rb
openall_time_applet-0.0.26 spec/tray_timelogs_spec.rb