Sha256: c866b454f04321420e39e2b823ea71ec4b9f4986ed2773ffb9c5a1e0ff23a0bb

Contents?: true

Size: 1.52 KB

Versions: 1

Compression:

Stored size: 1.52 KB

Contents

require 'spec_helper'

describe Mavenlink::TimeEntry, stub_requests: true do
  it_should_behave_like 'model', 'time_entries'

  describe 'validations' do
    it { should validate_presence_of :workspace_id }
    it { should validate_presence_of :date_performed }
    it { should validate_presence_of :time_in_minutes }
  end

  describe 'associations' do
    it { should respond_to :workspace }
    it { should respond_to :user }
    it { should respond_to :story }
  end

  it 'should respond to expected attributes' do
    should respond_to(:created_at, :updated_at, :date_performed, :story_id,
                      :time_in_minutes, :billable, :notes, :rate_in_cents,
                      :currency, :currency_symbol, :currency_base_unit,
                      :user_can_edit, :workspace_id, :user_id, :approved,
                      :role_id, :external_reference, :location)
  end

  describe '.create_attributes' do
    let(:subject) { described_class.create_attributes }

    it 'includes expected attributes' do
      should match_array(%w(workspace_id date_performed time_in_minutes billable cost_rate_in_cents
                            notes rate_in_cents story_id user_id external_reference location))
    end
  end

  describe '.update_attributes' do
    let(:subject) { described_class.update_attributes }

    it 'includes expected attributes' do
      should match_array(%w(date_performed time_in_minutes billable notes cost_rate_in_cents
                            rate_in_cents story_id user_id external_reference))
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mavenlink-0.0.1 spec/lib/mavenlink/time_entry_spec.rb