Sha256: 3c62fb9a52aa1cc516bb0cbc1691c7d92233405c71a240bd222a1329d01aff17

Contents?: true

Size: 1.75 KB

Versions: 28

Compression:

Stored size: 1.75 KB

Contents

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

class TestReleases < MiniTest::Unit::TestCase

  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

28 entries across 28 versions & 2 rubygems

Version Path
heroku-api-0.3.11 test/test_releases.rb
heroku-api-0.3.10 test/test_releases.rb
pogoapp-api-0.3.8 test/test_releases.rb
heroku-api-0.3.9 test/test_releases.rb
heroku-api-0.3.8 test/test_releases.rb
heroku-api-0.3.7 test/test_releases.rb
heroku-api-0.3.6 test/test_releases.rb
heroku-api-0.3.5 test/test_releases.rb
heroku-api-0.3.4 test/test_releases.rb
heroku-api-0.3.3 test/test_releases.rb
heroku-api-0.3.2 test/test_releases.rb
heroku-api-0.3.1 test/test_releases.rb
heroku-api-0.3.0 test/test_releases.rb
heroku-api-0.2.13 test/test_releases.rb
heroku-api-0.2.12 test/test_releases.rb
heroku-api-0.2.11 test/test_releases.rb
heroku-api-0.2.10 test/test_releases.rb
heroku-api-0.2.9 test/test_releases.rb
heroku-api-0.2.8 test/test_releases.rb
heroku-api-0.2.7 test/test_releases.rb