Sha256: 90a21a11739e8cb90f51eec21759ca613ca70c450f6c877a7e445335f31b536b

Contents?: true

Size: 1.43 KB

Versions: 36

Compression:

Stored size: 1.43 KB

Contents

class ResourceTestCase

  shared "return 400 because no params were given" do
    use "return 400 Bad Request"
    
    test "body should say no params were given" do
      assert_include "errors", parsed_response_body
      assert_include "no_params", parsed_response_body["errors"]
    end
  end

  shared "return 400 because params were not empty" do
    use "return 400 Bad Request"
    
    test "body should say params were non-empty" do
      assert_include "errors", parsed_response_body
      assert_include "non_empty_params", parsed_response_body["errors"]
    end
  end
  
  shared "return 401 because the API key is invalid" do
    use "return 401 Unauthorized"
    
    test "body should say the API key is invalid" do
      assert_include "errors", parsed_response_body
      assert_include "invalid_api_key", parsed_response_body["errors"]
    end
  end
  
  shared "return 401 because the API key is missing" do
    use "return 401 Unauthorized"
    
    test "body should say the API key is missing" do
      assert_include "errors", parsed_response_body
      assert_include "missing_api_key", parsed_response_body["errors"]
    end
  end
  
  shared "return 401 because the API key is unauthorized" do
    use "return 401 Unauthorized"
    
    test "body should say the API key is unauthorized" do
      assert_include "errors", parsed_response_body
      assert_include "unauthorized_api_key", parsed_response_body["errors"]
    end
  end

end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
sinatra_resource-0.4.1 examples/datacatalog/test/helpers/shared/api_keys.rb
sinatra_resource-0.4.0 examples/datacatalog/test/helpers/shared/api_keys.rb
sinatra_resource-0.3.6 examples/datacatalog/test/helpers/shared/api_keys.rb
sinatra_resource-0.3.5 examples/datacatalog/test/helpers/shared/api_keys.rb
sinatra_resource-0.3.4 examples/datacatalog/test/helpers/shared/api_keys.rb
sinatra_resource-0.3.3 examples/datacatalog/test/helpers/shared/api_keys.rb
sinatra_resource-0.3.2 examples/datacatalog/test/helpers/shared/api_keys.rb
sinatra_resource-0.3.1 examples/datacatalog/test/helpers/shared/api_keys.rb
sinatra_resource-0.3.0 examples/datacatalog/test/helpers/shared/api_keys.rb
sinatra_resource-0.2.6 examples/datacatalog/test/helpers/shared/api_keys.rb
sinatra_resource-0.2.5 examples/datacatalog/test/helpers/shared/api_keys.rb
sinatra_resource-0.2.4 examples/datacatalog/test/helpers/shared/api_keys.rb
sinatra_resource-0.2.3 examples/datacatalog/test/helpers/shared/api_keys.rb
sinatra_resource-0.2.2 examples/datacatalog/test/helpers/shared/api_keys.rb
sinatra_resource-0.2.1 examples/datacatalog/test/helpers/shared/api_keys.rb
sinatra_resource-0.2.0 examples/datacatalog/test/helpers/shared/api_keys.rb