Sha256: 8b8f6d6878755b146882808354a0c3d49c25a63d2df4c2753952ed9ef7b3c5f9

Contents?: true

Size: 911 Bytes

Versions: 7

Compression:

Stored size: 911 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

7 entries across 7 versions & 1 rubygems

Version Path
tracker_api-1.16.0 test/workspace_test.rb
tracker_api-1.15.0 test/workspace_test.rb
tracker_api-1.14.0 test/workspace_test.rb
tracker_api-1.13.0 test/workspace_test.rb
tracker_api-1.12.0 test/workspace_test.rb
tracker_api-1.11.0 test/workspace_test.rb
tracker_api-1.10.0 test/workspace_test.rb