Sha256: 464bee3ce14b4ee266569a215a0449ebc340914ae329dd8fe894b403336b0b98

Contents?: true

Size: 1.15 KB

Versions: 12

Compression:

Stored size: 1.15 KB

Contents

# encoding: UTF-8

require 'gooddata/connection'
require 'gooddata/core/project'
require 'gooddata/models/project'

describe 'GoodData - project' do
  before(:each) do
    @client = ConnectionHelper.create_default_connection
  end

  after(:each) do
    @client.disconnect
  end

  describe '#project=' do
    it 'Assigns nil' do
      GoodData.project = nil
    end

    it 'Assigns project using project ID' do
      GoodData.use(ProjectHelper::PROJECT_ID, client: @client)
    end

    it 'Assigns project using project URL' do
      GoodData.use ProjectHelper::PROJECT_URL, client: @client
    end

    it 'Assigns project directly' do
      GoodData.project = GoodData::Project[ProjectHelper::PROJECT_ID, client: @client]
    end
  end

  describe '#project' do
    it 'Returns project assigned' do
      GoodData.project = nil
      GoodData.project.should == nil

      GoodData.use ProjectHelper::PROJECT_ID, client: @client
      GoodData.project.should_not == nil
    end
  end

  describe '#with_project' do
    it 'Uses project specified' do
      GoodData.with_project GoodData::Project[ProjectHelper::PROJECT_ID, :client => @client] do
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
gooddata-0.6.20 spec/unit/core/project_spec.rb
gooddata-0.6.19 spec/unit/core/project_spec.rb
gooddata-0.6.18 spec/unit/core/project_spec.rb
gooddata-0.6.17 spec/unit/core/project_spec.rb
gooddata-0.6.16 spec/unit/core/project_spec.rb
gooddata-0.6.15 spec/unit/core/project_spec.rb
gooddata-0.6.14 spec/unit/core/project_spec.rb
gooddata-0.6.13 spec/unit/core/project_spec.rb
gooddata-0.6.12 spec/unit/core/project_spec.rb
gooddata-0.6.11 spec/unit/core/project_spec.rb
gooddata-0.6.10 spec/unit/core/project_spec.rb
gooddata-0.6.9 spec/unit/core/project_spec.rb