Sha256: a7cde9a5780adbf7556eabdda858d02772e5992a942012a366e82ac97dc875c4

Contents?: true

Size: 725 Bytes

Versions: 1

Compression:

Stored size: 725 Bytes

Contents

require 'spec_helper'

describe PGit::Pivotal::Iteration do
  describe '#new with hash' do
    it 'should instantiate stories' do
      iterations_string = File.read(File.join(PGit.root, 'spec', 'fixtures', 'iterations'))
      iteration_hashes = JSON.parse(iterations_string)
      first_iteration_hash = iteration_hashes.first
      current_project = instance_double('PGit::CurrentProject', id: 123, api_token: 'haba')
      allow(PGit::CurrentProject).to receive(:new).and_return(current_project)
      iteration = PGit::Pivotal::Iteration.new do |iteration|
        iteration.hash = first_iteration_hash
      end

      first_story = iteration.stories.first
      expect(first_story.id).to eq 90501214
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pgit-1.0.0 spec/pgit/pivotal/iteration_spec.rb