You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2019/06/20 20:42:49 UTC

[GitHub] [couchdb] iilyak commented on issue #2007: Port javascript tests auth cache, cookie auth and users db to elixir

iilyak commented on issue #2007: Port javascript tests auth cache, cookie auth and users db to elixir
URL: https://github.com/apache/couchdb/pull/2007#issuecomment-504175553
 
 
   This PR is almost there. You did an enormous amount of work. It just needs little refactoring. My worry is that in the current form it is too close to JavaScript's big monolithic test. It would be nice to split big test into multiple smaller ones. The elixir framework in its current shape has few features which can be used here. For example instead of relying on `run_on_modified_server` it might be possible to use `@moduletag config`
   
   ```
   defmodule CookieAuthTest do
     ...
     @moduletag config: [
        {"chttpd_auth", "authentication_db", db_name},
        {"chttpd_auth", "auth_cache_size", "3"},
        {"httpd", "authentication_handlers", "{couch_httpd_auth, default_authentication_handler}"},
        {"chttpd_auth", "secret", generate_secret(64)}  
     ]
     test "that the users db is born with the auth ddoc" do
        ...
     end
   
     test "we can't create _names" do
       ...
     end
   
     test "we can't create malformed ids" do
       ...
     end
   
     test "login works" do
       ...
     end
   
     test "can't delete another users doc unless you are admin" do
       ...
     end
   
     test "redirect on success" do
       ...
     end
   
     test "redirect on failure" do
       ...
     end
   
     ...and so on...
   end
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services