Sha256: c854e7bc96450db888f762793c43b41c0a5ee4a9a6450355175746e37b95b06e

Contents?: true

Size: 1.74 KB

Versions: 16

Compression:

Stored size: 1.74 KB

Contents

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

class TestReleases < Minitest::Test

  def test_get_releases
    with_app do |app_data|
      response = heroku.get_releases(app_data['name'])

      assert_equal(200, response.status)
      # body assertion?
    end
  end

  def test_get_releases_app_not_found
    assert_raises(Heroku::API::Errors::NotFound) do
      heroku.get_releases(random_name)
    end
  end

  def test_get_release
    with_app do |app_data|
      current = heroku.get_releases(app_data['name']).body.last['name']
      response = heroku.get_release(app_data['name'], current)

      assert_equal(200, response.status)
      # body assertion?
    end
  end

  def test_get_release_current
    with_app do |app_data|
      response = heroku.get_release(app_data['name'], 'current')

      assert_equal(200, response.status)
      # body assertion?
    end
  end

  def test_get_release_app_not_found
    assert_raises(Heroku::API::Errors::NotFound) do
      heroku.get_release(random_name, 'v2')
    end
  end

  def test_get_release_release_not_found
    assert_raises(Heroku::API::Errors::NotFound) do
      heroku.get_release(random_name, 'v0')
    end
  end

  def test_post_release
    with_app do |app_data|
      current = heroku.get_releases(app_data['name']).body.last['name']
      response = heroku.post_release(app_data['name'], current)

      assert_equal(200, response.status)
      # body assertion?
    end
  end

  def test_post_release_app_not_found
    assert_raises(Heroku::API::Errors::NotFound) do
      heroku.post_release(random_name, 'v3')
    end
  end

  def test_post_release_release_not_found
    assert_raises(Heroku::API::Errors::NotFound) do
      heroku.post_release(random_name, 'v0')
    end
  end

end

Version data entries

16 entries across 16 versions & 1 rubygems

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