Sha256: 355c1d3109e38edbf7247d2d506bea3d0176f86b212dcc7cd80a7ff073f576a1

Contents?: true

Size: 896 Bytes

Versions: 11

Compression:

Stored size: 896 Bytes

Contents

require_relative 'minitest_helper'

describe TrackerApi::Resources::Workspace do
  let(:pt_user) { PT_USER_2 }
  let(:client) { TrackerApi::Client.new token: pt_user[:token] }
  let(:workspace_id) { pt_user[:workspace_id] }
  let(:workspace) { VCR.use_cassette('get workspace') { client.workspace(workspace_id) } }

  describe '.projects' do
    it 'gets all projects for this workspace' do
      VCR.use_cassette('get workspace projects', record: :new_episodes) do
        workspace = client.workspace(pt_user[:workspace_id], fields: ':default,projects(id,name)')
        projects = workspace.projects

        projects.wont_be_empty

        projects.size.must_equal 2
        projects.first.must_be_instance_of TrackerApi::Resources::Project

        pt_user[:project_ids].must_include projects.first.id
        pt_user[:project_ids].must_include projects.last.id
      end
    end

  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
tracker_api-1.9.1 test/workspace_test.rb
tracker_api-1.9.0 test/workspace_test.rb
tracker_api-1.8.0 test/workspace_test.rb
tracker_api-1.7.1 test/workspace_test.rb
tracker_api-1.7.0 test/workspace_test.rb
tracker_api-1.6.0 test/workspace_test.rb
tracker_api-1.5.0 test/workspace_test.rb
tracker_api-1.4.1 test/workspace_test.rb
tracker_api-1.4.0 test/workspace_test.rb
tracker_api-1.3.0 test/workspace_test.rb
tracker_api-1.2.1 test/workspace_test.rb