Sha256: 66643e76d18adc3492233d34e0146a783725697f592f5ffc0c86face2ca510a1

Contents?: true

Size: 620 Bytes

Versions: 20

Compression:

Stored size: 620 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

20 entries across 20 versions & 2 rubygems

Version Path
maestrano-rails-0.15.4 test/controllers/metadata_controller_test.rb
maestrano-rails-0.15.2 test/controllers/metadata_controller_test.rb
maestrano-rails-0.15.1 test/controllers/metadata_controller_test.rb
maestrano-rails-0.15.0 test/controllers/metadata_controller_test.rb
maestrano-rails-0.14.0 test/controllers/metadata_controller_test.rb
maestrano-rails-0.13.0 test/controllers/metadata_controller_test.rb
maestrano-rails-0.12.0 test/controllers/metadata_controller_test.rb
maestrano-rails-0.11.0 test/controllers/metadata_controller_test.rb
maestrano-rails-0.10.0 test/controllers/metadata_controller_test.rb
maestrano-rails-0.9.5 test/controllers/metadata_controller_test.rb
maestrano-rails-0.9.4 test/controllers/metadata_controller_test.rb
maestrano-rails-test-0.9.4 test/controllers/metadata_controller_test.rb
maestrano-rails-test-0.9.3 test/controllers/metadata_controller_test.rb
maestrano-rails-0.9.3 test/controllers/metadata_controller_test.rb
maestrano-rails-0.9.2 test/controllers/metadata_controller_test.rb
maestrano-rails-0.9.1 test/controllers/metadata_controller_test.rb
maestrano-rails-0.9.0 test/controllers/metadata_controller_test.rb
maestrano-rails-0.8.0 test/controllers/metadata_controller_test.rb
maestrano-rails-0.7.0 test/controllers/metadata_controller_test.rb
maestrano-rails-0.6.0 test/controllers/metadata_controller_test.rb