Sha256: 0dea2748255650d23a0ea58b791a43672f472a343a6093115daa585577fc20b8

Contents?: true

Size: 1.64 KB

Versions: 6

Compression:

Stored size: 1.64 KB

Contents

# encoding: UTF-8

require 'gooddata/cli/cli'

describe 'GoodData::CLI - domain' do
  describe 'domain' do
    it 'Complains when no subcommand specified' do
      args = %w(domain)

      out = run_cli(args)
      out.should include "Command 'domain' requires a subcommand add_user,list_users"
    end
  end

  describe "domain add_user" do
    TEST_DOMAIN = 'gooddata'
    TEST_EMAIL = 'joe.doe@gooddata.com'
    TEST_PASSWORD = 'p4ssw0rth'

    it "Outputs 'Domain name has to be provided' if none specified" do
      args = %w(domain add_user)

      out = run_cli(args)
      out.should include 'Domain name has to be provided'
    end

    it "Outputs 'Email has to be provided' if none specified" do
      args = [
        'domain',
        'add_user',
        TEST_DOMAIN
      ]

      out = run_cli(args)
      out.should include 'Email has to be provided'
    end

    it "Outputs 'Password has to be provided' if none specified" do
      args = [
        'domain',
        'add_user',
        TEST_DOMAIN,
        TEST_EMAIL
      ]

      out = run_cli(args)
      out.should include 'Password has to be provided'
    end

    it 'Works' do
      args = [
        'domain',
        'add_user',
        TEST_DOMAIN,
        TEST_EMAIL,
        TEST_PASSWORD
      ]

      out = run_cli(args)
    end

  end

  describe 'domain list_users' do
    it 'Complains when no parameters specified' do
      args = %w(domain list_users)

      out = run_cli(args)
      out.should include 'Domain name has to be provided'
    end

    it 'Works' do
      args = [
        'domain',
        'list_users',
        'gooddata'
      ]

      out = run_cli(args)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
gooddata-0.6.7 spec/unit/cli/commands/cmd_domain_spec.rb
gooddata-0.6.6 spec/unit/cli/commands/cmd_domain_spec.rb
gooddata-0.6.5 spec/unit/cli/commands/cmd_domain_spec.rb
gooddata-0.6.4 spec/unit/cli/commands/cmd_domain_spec.rb
gooddata-0.6.3 spec/unit/cli/commands/cmd_domain_spec.rb
gooddata-0.6.2 spec/unit/cli/commands/cmd_domain_spec.rb