Sha256: 0d6e12db9b9305a5b3230851db0f0e28777ffd7c23c6d2625dfb19712ab4bc34

Contents?: true

Size: 888 Bytes

Versions: 1

Compression:

Stored size: 888 Bytes

Contents

# encoding: UTF-8

require 'spec_helper'

describe Contactology::Issues do
  let(:issues) { Contactology::Issues.new }
  subject { issues }

  it 'is empty by default' do
    issues.should be_empty
  end

  it 'holds Contactology::Issue objects' do
    issues = Contactology::Issues.new('issues' => [attributes_for(:issue)])
    issues.should_not be_empty
    issues.all? { |i| i.kind_of?(Contactology::Issue) }.should be_true
  end

  it 'converts pushed objects to Issue instances' do
    expect {
      issues << attributes_for(:issue)
    }.to change(issues, :size).by(1)

    issues.all? { |i| i.kind_of? Contactology::Issue }.should be_true
  end

  context '#score' do
    it 'defaults to 0' do
      Contactology::Issues.new.score.should == 0
    end

    it 'may be set during initialization' do
      Contactology::Issues.new('score' => 95).score.should == 95
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
contactology-1.0.0 spec/models/contactology/issues_spec.rb