Sha256: 4c4abab6b9f811cbbcb475b8b759439175110ad72511ec3e9422e2a09f90f2af

Contents?: true

Size: 1.45 KB

Versions: 2

Compression:

Stored size: 1.45 KB

Contents

# encoding: UTF-8
#
# Copyright (c) 2010-2017 GoodData Corporation. All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

require 'gooddata'

describe GoodData::Label do
  before(:all) do
    @rest_client = ConnectionHelper.create_default_connection
    @suffix = AppstoreProjectHelper.suffix
    @opts = {
      client: @rest_client,
      title: "Project for label spec #{@suffix}",
      auth_token: ConnectionHelper::GD_PROJECT_TOKEN,
      environment: 'TESTING',
      prod_organization: 'staging-lcm-prod'
    }
    project_helper = AppstoreProjectHelper.create(@opts)
    project_helper.create_ldm
    project_helper.load_data
    @project = project_helper.project
    @label = @project.attributes('label.csv_policies.customer')
  end
  after(:all) do
    @project.delete unless @project.deleted?
  end
  # this is a substring of another value in the set, AA10041
  let(:expected_id) { 'AA1004' }

  describe '#get_valid_elements' do
    it 'returns an exact match' do
      eles = @label.get_valid_elements filter: expected_id
      eles['validElements']['items'].each do |ele|
        expect(ele['element']['title']).to eq expected_id
      end
    end
  end

  context 'updating metadata' do
    it 'sets the label as deprecated' do
      @label.meta['deprecated'] = 1
      @label.save
      @label.reload!
      expect(@label.meta['deprecated']).to eq("1")
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gooddata-1.1.0-java spec/integration/models/label_spec.rb
gooddata-1.1.0 spec/integration/models/label_spec.rb