Sha256: 94ba1b397a4aa2bf278dd6de78cbda12ae8240ce4075f2c164ca9c38c53511f5

Contents?: true

Size: 1.96 KB

Versions: 13

Compression:

Stored size: 1.96 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::ChannelConfiguration, :constraint => 'slow' do
  before(:all) do
    @client = ConnectionHelper.create_default_connection
  end

  after(:all) do
    @client.disconnect
  end

  it 'should be able to create a channel' do
    begin
      channel = GoodData::ChannelConfiguration.create(client: @client)
      expect(channel.to).to eq ConnectionHelper::DEFAULT_USERNAME
      expect(channel.title).to eq ConnectionHelper::DEFAULT_USERNAME
    ensure
      channel && channel.delete
    end
  end

  it 'should not create dubplicate channel' do
    begin
      channel = GoodData::ChannelConfiguration.create(client: @client)
      GoodData::ChannelConfiguration.create(client: @client, title: 'another channel')
      expect(GoodData::ChannelConfiguration.all).to eq [channel]
    ensure
      channel && channel.delete
    end
  end

  it 'should be able to edit a channel' do
    begin
      channel = GoodData::ChannelConfiguration.create(client: @client, title: 'my channel')
      expect(channel.to).to eq ConnectionHelper::DEFAULT_USERNAME
      expect(channel.title).to eq 'my channel'

      channel.title = 'New title'
      channel.save

      expect(GoodData::ChannelConfiguration[channel.channel_id].title).to eq 'New title'
    ensure
      channel && channel.delete
    end
  end

  it 'should be able to list all channels' do
    begin
      expect(GoodData::ChannelConfiguration.all).to eq []
      channel = GoodData::ChannelConfiguration.create(client: @client)
      expect(GoodData::ChannelConfiguration.all).to eq [channel]
    ensure
      channel && channel.delete
    end
  end

  it 'should be able to delete a channel' do
    channel = GoodData::ChannelConfiguration.create(client: @client)
    channel.delete
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
gooddata-1.1.0-java spec/integration/channel_configuration_spec.rb
gooddata-1.1.0 spec/integration/channel_configuration_spec.rb
gooddata-1.0.2-java spec/integration/channel_configuration_spec.rb
gooddata-1.0.2 spec/integration/channel_configuration_spec.rb
gooddata-1.0.1 spec/integration/channel_configuration_spec.rb
gooddata-1.0.1-java spec/integration/channel_configuration_spec.rb
gooddata-1.0.0-java spec/integration/channel_configuration_spec.rb
gooddata-1.0.0 spec/integration/channel_configuration_spec.rb
gooddata-0.6.54 spec/integration/channel_configuration_spec.rb
gooddata-0.6.53 spec/integration/channel_configuration_spec.rb
gooddata-0.6.52 spec/integration/channel_configuration_spec.rb
gooddata-0.6.51 spec/integration/channel_configuration_spec.rb
gooddata-0.6.50 spec/integration/channel_configuration_spec.rb