Sha256: 329f87afec95667371798e49600c64d480ff9ac3be67d5eee6c55602fe1f97ec

Contents?: true

Size: 1.43 KB

Versions: 16

Compression:

Stored size: 1.43 KB

Contents

require File.expand_path("#{File.dirname(__FILE__)}/test_helper")

class TestConfigVars < Minitest::Test

  def test_delete_app_config_var
    with_app('stack' => 'cedar') do |app_data|
      heroku.put_config_vars(app_data['name'], {'KEY' => 'value'})

      response = heroku.delete_config_var(app_data['name'], 'KEY')

      assert_equal(200, response.status)
      assert_equal({}, response.body)
    end
  end

  def test_delete_app_config_var_app_not_found
    assert_raises(Heroku::API::Errors::NotFound) do
      heroku.delete_config_var(random_name, 'key')
    end
  end

  def test_get_app_config_vars
    with_app('stack' => 'cedar') do |app_data|
      response = heroku.get_config_vars(app_data['name'])

      assert_equal(200, response.status)
      assert_equal({}, response.body)
    end
  end

  def test_get_app_config_vars_app_not_found
    assert_raises(Heroku::API::Errors::NotFound) do
      heroku.get_config_vars(random_name)
    end
  end

  def test_put_app_config_vars
    with_app('stack' => 'cedar') do |app_data|
      response = heroku.put_config_vars(app_data['name'], {'KEY' => 'value'})

      assert_equal(200, response.status)
      assert_equal({'KEY' => 'value'}, response.body)

      heroku.delete_config_var(app_data['name'], 'KEY')
    end
  end

  def test_put_app_config_vars_app_not_found
    assert_raises(Heroku::API::Errors::NotFound) do
      heroku.put_config_vars(random_name, {'KEY' => 'value'})
    end
  end

end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
heroku-api-0.4.3 test/test_config_vars.rb
heroku-api-0.4.2 test/test_config_vars.rb
heroku-api-0.4.1 test/test_config_vars.rb
heroku-api-0.4.0 test/test_config_vars.rb
heroku-api-0.3.23 test/test_config_vars.rb
heroku-api-0.3.22 test/test_config_vars.rb
heroku-api-0.3.21 test/test_config_vars.rb
heroku-api-0.3.20 test/test_config_vars.rb
heroku-api-0.3.19 test/test_config_vars.rb
heroku-api-0.3.18 test/test_config_vars.rb
heroku-api-0.3.17 test/test_config_vars.rb
heroku-api-0.3.16 test/test_config_vars.rb
heroku-api-0.3.15 test/test_config_vars.rb
heroku-api-0.3.14 test/test_config_vars.rb
heroku-api-0.3.13 test/test_config_vars.rb
heroku-api-0.3.12 test/test_config_vars.rb