Commit 9e8c98dc57aa4aebd1a3c99299655c4d5e67be5e

Authored by João M. M. da Silva + Diego Araújo
Committed by João M. M. da Silva
1 parent 59fe4373

[Mezuro] Completed process time model, fixtures and tests.

plugins/mezuro/lib/kalibro/process_time.rb 0 → 100644
... ... @@ -0,0 +1,5 @@
  1 +class Kalibro::ProcessTime < Kalibro::Model
  2 +
  3 + attr_accessor :state, :time
  4 +
  5 +end
... ...
plugins/mezuro/test/fixtures/process_time_fixtures.rb 0 → 100644
... ... @@ -0,0 +1,11 @@
  1 +class ProcessTimeFixtures
  2 +
  3 + def self.process_time
  4 + Kalibro::ProcessTime.new process_time_hash
  5 + end
  6 +
  7 + def self.process_time_hash
  8 + {:state => "Ready", :time => 1}
  9 + end
  10 +
  11 +end
... ...
plugins/mezuro/test/unit/kalibro/process_time_test.rb 0 → 100644
... ... @@ -0,0 +1,20 @@
  1 +require "test_helper"
  2 +
  3 +require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/process_time_fixtures"
  4 +
  5 +class ProcessTimeTest < ActiveSupport::TestCase
  6 +
  7 + def setup
  8 + @hash = ProcessTimeFixtures.process_time_hash
  9 + @process_time = ProcessTimeFixtures.process_time
  10 + end
  11 +
  12 + should 'create process time from hash' do
  13 + assert_equal @hash[:state], Kalibro::ProcessTime.new(@hash).state
  14 + end
  15 +
  16 + should 'convert process time to hash' do
  17 + assert_equal @hash, @process_time.to_hash
  18 + end
  19 +
  20 +end
... ...