simon_says 0.3.0.alpha.6 → 0.3.0.alpha.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/locales/en.yml +4 -4
- data/lib/simon_says/version.rb +1 -1
- data/test/simon_says/authorizer_denied_test.rb +12 -12
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6237819c750073c6cebb87a4bcad4228b08afa6f3d7e91d0003050419f3089ca
|
4
|
+
data.tar.gz: 9c2dbfbe70db5a457d66f755a1a173dbdfa88571548e585ee9cee2a9d12f42c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: acacae099ec8987e3d443789624fc654ce5a79ea2a664e8e174961c893177b76e6e875e547be8e8fb7e6ace5d6ba581771b42f3d81d49877b6eb467414c22b23
|
7
|
+
data.tar.gz: 7bf75e746865375b16bf5384a5318b3f72224ddb099e3dd403535375ade5146cc5733febd36a3665a31ab6d341a93f0ccbab2fd2a3e05754e8db48ed3b938451
|
data/config/locales/en.yml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
en:
|
2
2
|
simon_says:
|
3
3
|
denied:
|
4
|
-
warning: Access denied
|
4
|
+
warning: 'Access denied:'
|
5
5
|
array_connector:
|
6
6
|
two_words_connector: ' or '
|
7
7
|
last_word_connector: ', or '
|
@@ -11,6 +11,6 @@ en:
|
|
11
11
|
other: '%{list} are required'
|
12
12
|
|
13
13
|
explanation:
|
14
|
-
zero: '%{warning} %{required}
|
15
|
-
one: '%{warning} %{required}
|
16
|
-
other: '%{warning} %{required}
|
14
|
+
zero: '%{warning} %{required}; however, you have no %{role_attr} set'
|
15
|
+
one: '%{warning} %{required}; however, you have %{actual} %{role_attr} set'
|
16
|
+
other: '%{warning} %{required}; however, you have %{actual} %{role_attr} set'
|
data/lib/simon_says/version.rb
CHANGED
@@ -4,72 +4,72 @@ class AuthorizerAccessDeniedTest < ActiveSupport::TestCase
|
|
4
4
|
test 'one required and none set' do
|
5
5
|
err = SimonSays::Authorizer::Denied.new(:roles, %w(foo), [])
|
6
6
|
|
7
|
-
assert_equal 'Access denied
|
7
|
+
assert_equal 'Access denied: foo is required; however, you have no roles set', err.message
|
8
8
|
end
|
9
9
|
|
10
10
|
test 'two required and none set' do
|
11
11
|
err = SimonSays::Authorizer::Denied.new(:roles, %w(foo bar), [])
|
12
12
|
|
13
|
-
assert_equal 'Access denied
|
13
|
+
assert_equal 'Access denied: foo or bar are required; however, you have no roles set', err.message
|
14
14
|
end
|
15
15
|
|
16
16
|
test 'three required and none set' do
|
17
17
|
err = SimonSays::Authorizer::Denied.new(:roles, %w(foo bar baz), [])
|
18
18
|
|
19
|
-
assert_equal 'Access denied
|
19
|
+
assert_equal 'Access denied: foo, bar, or baz are required; however, you have no roles set', err.message
|
20
20
|
end
|
21
21
|
|
22
22
|
test 'one required and one set' do
|
23
23
|
err = SimonSays::Authorizer::Denied.new(:roles, %w(foo), %w(qux))
|
24
24
|
|
25
|
-
assert_equal 'Access denied
|
25
|
+
assert_equal 'Access denied: foo is required; however, you have qux roles set', err.message
|
26
26
|
end
|
27
27
|
|
28
28
|
test 'two required and one set' do
|
29
29
|
err = SimonSays::Authorizer::Denied.new(:roles, %w(foo bar), %w(qux))
|
30
30
|
|
31
|
-
assert_equal 'Access denied
|
31
|
+
assert_equal 'Access denied: foo or bar are required; however, you have qux roles set', err.message
|
32
32
|
end
|
33
33
|
|
34
34
|
test 'three required and one set' do
|
35
35
|
err = SimonSays::Authorizer::Denied.new(:roles, %w(foo bar baz), %w(qux))
|
36
36
|
|
37
|
-
assert_equal 'Access denied
|
37
|
+
assert_equal 'Access denied: foo, bar, or baz are required; however, you have qux roles set', err.message
|
38
38
|
end
|
39
39
|
|
40
40
|
test 'one required and two set' do
|
41
41
|
err = SimonSays::Authorizer::Denied.new(:roles, %w(foo), %w(qux quux))
|
42
42
|
|
43
|
-
assert_equal 'Access denied
|
43
|
+
assert_equal 'Access denied: foo is required; however, you have qux and quux roles set', err.message
|
44
44
|
end
|
45
45
|
|
46
46
|
test 'two required and two set' do
|
47
47
|
err = SimonSays::Authorizer::Denied.new(:roles, %w(foo bar), %w(qux quux))
|
48
48
|
|
49
|
-
assert_equal 'Access denied
|
49
|
+
assert_equal 'Access denied: foo or bar are required; however, you have qux and quux roles set', err.message
|
50
50
|
end
|
51
51
|
|
52
52
|
test 'three required and two set' do
|
53
53
|
err = SimonSays::Authorizer::Denied.new(:roles, %w(foo bar baz), %w(qux quux))
|
54
54
|
|
55
|
-
assert_equal 'Access denied
|
55
|
+
assert_equal 'Access denied: foo, bar, or baz are required; however, you have qux and quux roles set', err.message
|
56
56
|
end
|
57
57
|
|
58
58
|
test 'one required and three set' do
|
59
59
|
err = SimonSays::Authorizer::Denied.new(:roles, %w(foo), %w(qux quux quuz))
|
60
60
|
|
61
|
-
assert_equal 'Access denied
|
61
|
+
assert_equal 'Access denied: foo is required; however, you have qux, quux, and quuz roles set', err.message
|
62
62
|
end
|
63
63
|
|
64
64
|
test 'two required and three set' do
|
65
65
|
err = SimonSays::Authorizer::Denied.new(:roles, %w(foo bar), %w(qux quux quuz))
|
66
66
|
|
67
|
-
assert_equal 'Access denied
|
67
|
+
assert_equal 'Access denied: foo or bar are required; however, you have qux, quux, and quuz roles set', err.message
|
68
68
|
end
|
69
69
|
|
70
70
|
test 'three required and three set' do
|
71
71
|
err = SimonSays::Authorizer::Denied.new(:roles, %w(foo bar baz), %w(qux quux quuz))
|
72
72
|
|
73
|
-
assert_equal 'Access denied
|
73
|
+
assert_equal 'Access denied: foo, bar, or baz are required; however, you have qux, quux, and quuz roles set', err.message
|
74
74
|
end
|
75
75
|
end
|