Sha256: ee610a954455421ca3eb8cadcd9222eb8eabeccc7e47d42a12232b449dd3306d

Contents?: true

Size: 610 Bytes

Versions: 9

Compression:

Stored size: 610 Bytes

Contents

require 'test_helper'

class MetadataControllerTest < ActionController::TestCase
  tests Maestrano::Rails::MetadataController

  context "unauthenticated" do
    should "deny access" do
      get :index
      assert_equal '401', response.code
    end
  end

  context "authenticated" do
    setup do
      @request.env["HTTP_AUTHORIZATION"] = "Basic " + Base64.encode64("#{Maestrano.param('api.id')}:#{Maestrano.param('api.key')}")
    end

    should "be successful" do
      get :index
      assert_equal '200', response.code
      assert_equal Maestrano.to_metadata.to_json, response.body
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
maestrano-rails-1.0.0 test/controllers/metadata_controller_test.rb
maestrano-rails-1.0.0.pre.RC8 test/controllers/metadata_controller_test.rb
maestrano-rails-1.0.0.pre.RC7 test/controllers/metadata_controller_test.rb
maestrano-rails-1.0.0.pre.RC6 test/controllers/metadata_controller_test.rb
maestrano-rails-1.0.0.pre.RC5 test/controllers/metadata_controller_test.rb
maestrano-rails-1.0.0.pre.RC4 test/controllers/metadata_controller_test.rb
maestrano-rails-1.0.0.pre.RC3 test/controllers/metadata_controller_test.rb
maestrano-rails-1.0.0.pre.RC2 test/controllers/metadata_controller_test.rb
maestrano-rails-1.0.0.pre.RC1 test/controllers/metadata_controller_test.rb