Sha256: 92d5135146512872e9e4c93fd8ff4695427ef6a3b2cdc82b024e31eaefd289b9

Contents?: true

Size: 594 Bytes

Versions: 1

Compression:

Stored size: 594 Bytes

Contents

require 'test_helper'

class GroupsControllerTest < ActionController::TestCase
  tests Maestrano::AccountHook::GroupsController
  
  context "unauthenticated" do
    should "deny access" do
      delete :destroy, id: 'cld-1'
      assert_equal '401', response.code
    end
  end
  
  context "authenticated" do
    setup do
      @request.env["HTTP_AUTHORIZATION"] = "Basic " + Base64.encode64("#{Maestrano.param('app_id')}:#{Maestrano.param('api_key')}")
    end
    
    should "be successful" do
      delete :destroy, id: 'cld-1'
      assert_equal '200', response.code
    end
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
maestrano-rails-0.5.0 test/controllers/groups_controller_test.rb