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.21 examples/datacatalog/test/helpers/shared/api_keys.rb
sinatra_resource-0.4.20 examples/datacatalog/test/helpers/shared/api_keys.rb
sinatra_resource-0.4.19 examples/datacatalog/test/helpers/shared/api_keys.rb
sinatra_resource-0.4.18 examples/datacatalog/test/helpers/shared/api_keys.rb
sinatra_resource-0.4.17 examples/datacatalog/test/helpers/shared/api_keys.rb
sinatra_resource-0.4.16 examples/datacatalog/test/helpers/shared/api_keys.rb
sinatra_resource-0.4.15 examples/datacatalog/test/helpers/shared/api_keys.rb
sinatra_resource-0.4.14 examples/datacatalog/test/helpers/shared/api_keys.rb
sinatra_resource-0.4.13 examples/datacatalog/test/helpers/shared/api_keys.rb
sinatra_resource-0.4.12 examples/datacatalog/test/helpers/shared/api_keys.rb
sinatra_resource-0.4.11 examples/datacatalog/test/helpers/shared/api_keys.rb
sinatra_resource-0.4.10 examples/datacatalog/test/helpers/shared/api_keys.rb
sinatra_resource-0.4.9 examples/datacatalog/test/helpers/shared/api_keys.rb
sinatra_resource-0.4.8 examples/datacatalog/test/helpers/shared/api_keys.rb
sinatra_resource-0.4.7 examples/datacatalog/test/helpers/shared/api_keys.rb
sinatra_resource-0.4.6 examples/datacatalog/test/helpers/shared/api_keys.rb
sinatra_resource-0.4.5 examples/datacatalog/test/helpers/shared/api_keys.rb
sinatra_resource-0.4.4 examples/datacatalog/test/helpers/shared/api_keys.rb
sinatra_resource-0.4.3 examples/datacatalog/test/helpers/shared/api_keys.rb
sinatra_resource-0.4.2 examples/datacatalog/test/helpers/shared/api_keys.rb