Sha256: 46531042c1a9e107d52e071eb80694607fc1c79ddc2b9c52f36aad9b51406189

Contents?: true

Size: 1.1 KB

Versions: 15

Compression:

Stored size: 1.1 KB

Contents

require 'spec_helper'

module Server
  describe TimeEntry do
    describe "Attributes" do
      it { should respond_to :mtime }
    end

    describe "Validations" do
      it { should_not be_valid }

      it "should require an mtime" do
        t = FactoryGirl.build :time_entry, mtime: nil
        t.should_not be_valid
      end

      it "should require a hash" do
        m = FactoryGirl.build :time_entry, file_hash: nil
        m.should_not be_valid
      end

      it "should require an editor_name" do
        m = FactoryGirl.build :time_entry, editor_name: nil
        m.should_not be_valid
      end

      it "should require an editor_version" do
        m = FactoryGirl.build :time_entry, editor_version: nil
        m.should_not be_valid
      end

      it "should be valid if attributes requirements are met" do
        t = FactoryGirl.build :time_entry
        t.should be_valid
      end
    end

    describe "Associations" do
      it "should belong to a file" do
        f = FactoryGirl.create :file
        t = FactoryGirl.create :time_entry, file: f

        t.file.should == f
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
watch_tower-0.0.3 spec/watch_tower/server/models/time_entry_spec.rb
watch_tower-0.0.2 spec/watch_tower/server/models/time_entry_spec.rb
watch_tower-0.0.1 spec/watch_tower/server/models/time_entry_spec.rb
watch_tower-0.0.1.beta12 spec/watch_tower/server/models/time_entry_spec.rb
watch_tower-0.0.1.beta11 spec/watch_tower/server/models/time_entry_spec.rb
watch_tower-0.0.1.beta10 spec/watch_tower/server/models/time_entry_spec.rb
watch_tower-0.0.1.beta9 spec/watch_tower/server/models/time_entry_spec.rb
watch_tower-0.0.1.beta8 spec/watch_tower/server/models/time_entry_spec.rb
watch_tower-0.0.1.beta7 spec/watch_tower/server/models/time_entry_spec.rb
watch_tower-0.0.1.beta6 spec/watch_tower/server/models/time_entry_spec.rb
watch_tower-0.0.1.beta5 spec/watch_tower/server/models/time_entry_spec.rb
watch_tower-0.0.1.beta4 spec/watch_tower/server/models/time_entry_spec.rb
watch_tower-0.0.1.beta3 spec/watch_tower/server/models/time_entry_spec.rb
watch_tower-0.0.1.beta2 spec/watch_tower/server/models/time_entry_spec.rb
watch_tower-0.0.1.beta1 spec/watch_tower/server/models/time_entry_spec.rb