aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPaweł Chmielowski <pchmielowski@process-one.net>2016-05-30 21:45:12 +0200
committerPaweł Chmielowski <pchmielowski@process-one.net>2016-05-30 23:06:29 +0200
commit17f87eb89960499b2fbb3be6ac3f687b5d33ed1d (patch)
tree30f7201ad370c2eaa5ea6530b5db57c9be85e916 /test
parentBetter code for setting up ejabberd app location (diff)
Fix tests
Diffstat (limited to 'test')
-rw-r--r--test/ejabberd_commands_mock_test.exs18
1 files changed, 11 insertions, 7 deletions
diff --git a/test/ejabberd_commands_mock_test.exs b/test/ejabberd_commands_mock_test.exs
index 285585034..487cf6a4b 100644
--- a/test/ejabberd_commands_mock_test.exs
+++ b/test/ejabberd_commands_mock_test.exs
@@ -127,6 +127,8 @@ defmodule EjabberdCommandsMockTest do
test "API command can be registered and executed" do
+ mock_commands_config
+
# Create & register a mocked command test() -> :result
command_name = :test
function = :test_command
@@ -142,6 +144,8 @@ defmodule EjabberdCommandsMockTest do
end
test "API command with versions can be registered and executed" do
+ mock_commands_config
+
command_name = :test
function1 = :test_command1
@@ -409,13 +413,13 @@ defmodule EjabberdCommandsMockTest do
:meck.expect(:ejabberd_config, :get_myhosts,
fn() -> [@domain] end)
:meck.new :acl
- :meck.expect(:acl, :match_rule,
- fn(@domain, :commands_admin_access, user) ->
- case :jlib.make_jid(@admin, @domain, "") do
- ^user -> :allow
- _ -> :deny
- end
- (@domain, :all, _user) ->
+ :meck.expect(:acl, :access_matches,
+ fn(:commands_admin_access, info, _scope) ->
+ case info do
+ %{usr: {@admin, @domain, _}} -> :allow
+ _ -> :deny
+ end;
+ (:all, _, _scope) ->
:allow
end)
end