Don't assume there's only a limited set of permissions
This commit is contained in:
		
							parent
							
								
									d2a1367168
								
							
						
					
					
						commit
						c6a2a5e6e1
					
				| 
						 | 
				
			
			@ -55,10 +55,12 @@ defmodule ListPermissionsCommandTest do
 | 
			
		|||
  end
 | 
			
		||||
 | 
			
		||||
  @tag test_timeout: @default_timeout
 | 
			
		||||
  test "no options lists permissions on the default", context do
 | 
			
		||||
  test "no options lists permissions in default vhost", context do
 | 
			
		||||
    capture_io(fn ->
 | 
			
		||||
      assert ListPermissionsCommand.run([], context[:opts]) ==
 | 
			
		||||
        [[user: "guest", configure: ".*", write: ".*", read: ".*"]]
 | 
			
		||||
      results = ListPermissionsCommand.run([], context[:opts])
 | 
			
		||||
      Enum.all?([[user: "guest", configure: ".*", write: ".*", read: ".*"]], fn(perm) ->
 | 
			
		||||
        Enum.find(results, fn(found) -> found == perm end)
 | 
			
		||||
      end)
 | 
			
		||||
    end)
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -84,8 +86,10 @@ defmodule ListPermissionsCommandTest do
 | 
			
		|||
  @tag test_timeout: 30
 | 
			
		||||
  test "sufficiently long timeouts don't interfere with results", context do
 | 
			
		||||
    capture_io(fn ->
 | 
			
		||||
      assert ListPermissionsCommand.run([], context[:opts]) ==
 | 
			
		||||
        [[user: "guest", configure: ".*", write: ".*", read: ".*"]]
 | 
			
		||||
      results = ListPermissionsCommand.run([], context[:opts])
 | 
			
		||||
      Enum.all?([[user: "guest", configure: ".*", write: ".*", read: ".*"]], fn(perm) ->
 | 
			
		||||
        Enum.find(results, fn(found) -> found == perm end)
 | 
			
		||||
      end)
 | 
			
		||||
    end)
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue