curupira 0.1.4 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +1 -0
- data/Gemfile.lock +131 -117
- data/app/controllers/curupira/authorized_controller.rb +1 -1
- data/app/controllers/curupira/passwords_controller.rb +1 -1
- data/app/controllers/curupira/sessions_controller.rb +1 -1
- data/curupira.gemspec +7 -7
- data/lib/curupira/version.rb +1 -1
- data/spec/controllers/controller_spec.rb +3 -2
- data/spec/controllers/groups_controller_spec.rb +16 -16
- data/spec/controllers/passwords_controller_spec.rb +20 -20
- data/spec/controllers/permissions_controller_spec.rb +1 -1
- data/spec/controllers/roles_controller_spec.rb +16 -16
- data/spec/controllers/sessions_controller_spec.rb +8 -8
- data/spec/controllers/users_controller_spec.rb +16 -16
- data/spec/dummy/app/views/base/index.html.erb +0 -0
- data/spec/rails_helper.rb +2 -2
- metadata +79 -35
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3b6a39dad23eab614842b91636087476be703f33
|
4
|
+
data.tar.gz: 72cd15719e81d0e3b33e7198e289803f4c389e07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5957098b830e7aca577eb799e2f93ec00fd4a36af636f02decdc8275cd65e4d96ce74de13ba2ba9810b4b42de593cd4f4b4911993b6ff2d3316bfd5f81bd37da
|
7
|
+
data.tar.gz: bee394fdcf33526336e02d34eb97c669368e2507eb75e260d886db473a53a3880205a21fadac341f66d5738dd6acc1cf6c3588f81c769f0a184614de06828e63
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,183 +1,196 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
curupira (0.1.
|
4
|
+
curupira (0.1.6)
|
5
5
|
cocoon
|
6
6
|
jquery-rails
|
7
|
-
rails (~>
|
7
|
+
rails (~> 5.1, >= 5.1.0)
|
8
8
|
sorcery
|
9
9
|
|
10
10
|
GEM
|
11
11
|
remote: https://rubygems.org/
|
12
12
|
specs:
|
13
|
-
|
14
|
-
actionpack (=
|
15
|
-
|
16
|
-
|
13
|
+
actioncable (5.1.0)
|
14
|
+
actionpack (= 5.1.0)
|
15
|
+
nio4r (~> 2.0)
|
16
|
+
websocket-driver (~> 0.6.1)
|
17
|
+
actionmailer (5.1.0)
|
18
|
+
actionpack (= 5.1.0)
|
19
|
+
actionview (= 5.1.0)
|
20
|
+
activejob (= 5.1.0)
|
17
21
|
mail (~> 2.5, >= 2.5.4)
|
18
|
-
rails-dom-testing (~>
|
19
|
-
actionpack (
|
20
|
-
actionview (=
|
21
|
-
activesupport (=
|
22
|
-
rack (~>
|
23
|
-
rack-test (~> 0.6.
|
24
|
-
rails-dom-testing (~>
|
22
|
+
rails-dom-testing (~> 2.0)
|
23
|
+
actionpack (5.1.0)
|
24
|
+
actionview (= 5.1.0)
|
25
|
+
activesupport (= 5.1.0)
|
26
|
+
rack (~> 2.0)
|
27
|
+
rack-test (~> 0.6.3)
|
28
|
+
rails-dom-testing (~> 2.0)
|
25
29
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
26
|
-
actionview (
|
27
|
-
activesupport (=
|
30
|
+
actionview (5.1.0)
|
31
|
+
activesupport (= 5.1.0)
|
28
32
|
builder (~> 3.1)
|
29
|
-
|
30
|
-
rails-dom-testing (~>
|
31
|
-
rails-html-sanitizer (~> 1.0, >= 1.0.
|
32
|
-
activejob (
|
33
|
-
activesupport (=
|
34
|
-
globalid (>= 0.3.
|
35
|
-
activemodel (
|
36
|
-
activesupport (=
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
33
|
+
erubi (~> 1.4)
|
34
|
+
rails-dom-testing (~> 2.0)
|
35
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
36
|
+
activejob (5.1.0)
|
37
|
+
activesupport (= 5.1.0)
|
38
|
+
globalid (>= 0.3.6)
|
39
|
+
activemodel (5.1.0)
|
40
|
+
activesupport (= 5.1.0)
|
41
|
+
activerecord (5.1.0)
|
42
|
+
activemodel (= 5.1.0)
|
43
|
+
activesupport (= 5.1.0)
|
44
|
+
arel (~> 8.0)
|
45
|
+
activesupport (5.1.0)
|
46
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
43
47
|
i18n (~> 0.7)
|
44
|
-
json (~> 1.7, >= 1.7.7)
|
45
48
|
minitest (~> 5.1)
|
46
|
-
thread_safe (~> 0.3, >= 0.3.4)
|
47
49
|
tzinfo (~> 1.1)
|
48
|
-
|
50
|
+
addressable (2.5.1)
|
51
|
+
public_suffix (~> 2.0, >= 2.0.2)
|
52
|
+
ammeter (1.1.4)
|
49
53
|
activesupport (>= 3.0)
|
50
54
|
railties (>= 3.0)
|
51
55
|
rspec-rails (>= 2.2)
|
52
|
-
arel (
|
56
|
+
arel (8.0.0)
|
53
57
|
bcrypt (3.1.11)
|
54
|
-
builder (3.2.
|
55
|
-
byebug (
|
56
|
-
|
57
|
-
|
58
|
+
builder (3.2.3)
|
59
|
+
byebug (9.0.6)
|
60
|
+
capybara (2.14.0)
|
61
|
+
addressable
|
58
62
|
mime-types (>= 1.16)
|
59
63
|
nokogiri (>= 1.3.3)
|
60
64
|
rack (>= 1.0.0)
|
61
65
|
rack-test (>= 0.5.4)
|
62
66
|
xpath (~> 2.0)
|
63
67
|
cocoon (1.2.9)
|
64
|
-
codeclimate-test-reporter (0.
|
65
|
-
simplecov (
|
66
|
-
coderay (1.1.
|
67
|
-
|
68
|
-
|
69
|
-
diff-lcs (1.2.5)
|
68
|
+
codeclimate-test-reporter (1.0.8)
|
69
|
+
simplecov (<= 0.13)
|
70
|
+
coderay (1.1.1)
|
71
|
+
concurrent-ruby (1.0.5)
|
72
|
+
diff-lcs (1.3)
|
70
73
|
docile (1.1.5)
|
71
|
-
|
72
|
-
factory_girl (4.
|
74
|
+
erubi (1.6.0)
|
75
|
+
factory_girl (4.8.0)
|
73
76
|
activesupport (>= 3.0.0)
|
74
|
-
factory_girl_rails (4.
|
75
|
-
factory_girl (~> 4.
|
77
|
+
factory_girl_rails (4.8.0)
|
78
|
+
factory_girl (~> 4.8.0)
|
76
79
|
railties (>= 3.0.0)
|
77
|
-
faraday (0.
|
80
|
+
faraday (0.11.0)
|
78
81
|
multipart-post (>= 1.2, < 3)
|
79
|
-
globalid (0.
|
80
|
-
activesupport (>= 4.
|
81
|
-
i18n (0.
|
82
|
-
jquery-rails (4.
|
82
|
+
globalid (0.4.0)
|
83
|
+
activesupport (>= 4.2.0)
|
84
|
+
i18n (0.8.1)
|
85
|
+
jquery-rails (4.3.1)
|
83
86
|
rails-dom-testing (>= 1, < 3)
|
84
87
|
railties (>= 4.2.0)
|
85
88
|
thor (>= 0.14, < 2.0)
|
86
|
-
json (1.
|
87
|
-
jwt (1.5.
|
88
|
-
loofah (2.0.
|
89
|
+
json (2.1.0)
|
90
|
+
jwt (1.5.6)
|
91
|
+
loofah (2.0.3)
|
89
92
|
nokogiri (>= 1.5.9)
|
90
|
-
mail (2.6.
|
93
|
+
mail (2.6.5)
|
91
94
|
mime-types (>= 1.16, < 4)
|
92
95
|
method_source (0.8.2)
|
93
|
-
mime-types (
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
96
|
+
mime-types (3.1)
|
97
|
+
mime-types-data (~> 3.2015)
|
98
|
+
mime-types-data (3.2016.0521)
|
99
|
+
mini_portile2 (2.1.0)
|
100
|
+
minitest (5.10.1)
|
101
|
+
multi_json (1.12.1)
|
102
|
+
multi_xml (0.6.0)
|
98
103
|
multipart-post (2.0.0)
|
99
|
-
|
100
|
-
|
104
|
+
nio4r (2.0.0)
|
105
|
+
nokogiri (1.7.1)
|
106
|
+
mini_portile2 (~> 2.1.0)
|
101
107
|
oauth (0.5.1)
|
102
|
-
oauth2 (1.
|
103
|
-
faraday (>= 0.8, < 0.
|
108
|
+
oauth2 (1.3.1)
|
109
|
+
faraday (>= 0.8, < 0.12)
|
104
110
|
jwt (~> 1.0)
|
105
111
|
multi_json (~> 1.3)
|
106
112
|
multi_xml (~> 0.5)
|
107
113
|
rack (>= 1.2, < 3)
|
108
|
-
pry (0.10.
|
114
|
+
pry (0.10.4)
|
109
115
|
coderay (~> 1.1.0)
|
110
116
|
method_source (~> 0.8.1)
|
111
117
|
slop (~> 3.4)
|
112
|
-
pry-rails (0.3.
|
113
|
-
pry (>= 0.
|
114
|
-
|
118
|
+
pry-rails (0.3.6)
|
119
|
+
pry (>= 0.10.4)
|
120
|
+
public_suffix (2.0.5)
|
121
|
+
rack (2.0.2)
|
115
122
|
rack-test (0.6.3)
|
116
123
|
rack (>= 1.0)
|
117
|
-
rails (
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
124
|
+
rails (5.1.0)
|
125
|
+
actioncable (= 5.1.0)
|
126
|
+
actionmailer (= 5.1.0)
|
127
|
+
actionpack (= 5.1.0)
|
128
|
+
actionview (= 5.1.0)
|
129
|
+
activejob (= 5.1.0)
|
130
|
+
activemodel (= 5.1.0)
|
131
|
+
activerecord (= 5.1.0)
|
132
|
+
activesupport (= 5.1.0)
|
125
133
|
bundler (>= 1.3.0, < 2.0)
|
126
|
-
railties (=
|
127
|
-
sprockets-rails
|
128
|
-
rails-
|
129
|
-
|
130
|
-
|
131
|
-
activesupport (
|
132
|
-
|
133
|
-
|
134
|
-
|
134
|
+
railties (= 5.1.0)
|
135
|
+
sprockets-rails (>= 2.0.0)
|
136
|
+
rails-controller-testing (1.0.1)
|
137
|
+
actionpack (~> 5.x)
|
138
|
+
actionview (~> 5.x)
|
139
|
+
activesupport (~> 5.x)
|
140
|
+
rails-dom-testing (2.0.2)
|
141
|
+
activesupport (>= 4.2.0, < 6.0)
|
142
|
+
nokogiri (~> 1.6)
|
143
|
+
rails-html-sanitizer (1.0.3)
|
135
144
|
loofah (~> 2.0)
|
136
|
-
railties (
|
137
|
-
actionpack (=
|
138
|
-
activesupport (=
|
145
|
+
railties (5.1.0)
|
146
|
+
actionpack (= 5.1.0)
|
147
|
+
activesupport (= 5.1.0)
|
148
|
+
method_source
|
139
149
|
rake (>= 0.8.7)
|
140
150
|
thor (>= 0.18.1, < 2.0)
|
141
|
-
rake (
|
142
|
-
rspec-core (3.
|
143
|
-
rspec-support (~> 3.
|
144
|
-
rspec-expectations (3.
|
151
|
+
rake (12.0.0)
|
152
|
+
rspec-core (3.6.0)
|
153
|
+
rspec-support (~> 3.6.0)
|
154
|
+
rspec-expectations (3.6.0)
|
145
155
|
diff-lcs (>= 1.2.0, < 2.0)
|
146
|
-
rspec-support (~> 3.
|
147
|
-
rspec-mocks (3.
|
156
|
+
rspec-support (~> 3.6.0)
|
157
|
+
rspec-mocks (3.6.0)
|
148
158
|
diff-lcs (>= 1.2.0, < 2.0)
|
149
|
-
rspec-support (~> 3.
|
150
|
-
rspec-rails (3.
|
151
|
-
actionpack (>= 3.0
|
152
|
-
activesupport (>= 3.0
|
153
|
-
railties (>= 3.0
|
154
|
-
rspec-core (~> 3.
|
155
|
-
rspec-expectations (~> 3.
|
156
|
-
rspec-mocks (~> 3.
|
157
|
-
rspec-support (~> 3.
|
158
|
-
rspec-support (3.
|
159
|
-
simplecov (0.
|
159
|
+
rspec-support (~> 3.6.0)
|
160
|
+
rspec-rails (3.6.0)
|
161
|
+
actionpack (>= 3.0)
|
162
|
+
activesupport (>= 3.0)
|
163
|
+
railties (>= 3.0)
|
164
|
+
rspec-core (~> 3.6.0)
|
165
|
+
rspec-expectations (~> 3.6.0)
|
166
|
+
rspec-mocks (~> 3.6.0)
|
167
|
+
rspec-support (~> 3.6.0)
|
168
|
+
rspec-support (3.6.0)
|
169
|
+
simplecov (0.13.0)
|
160
170
|
docile (~> 1.1.0)
|
161
|
-
|
162
|
-
simplecov-html (~> 0.
|
163
|
-
simplecov-html (0.
|
171
|
+
json (>= 1.8, < 3)
|
172
|
+
simplecov-html (~> 0.10.0)
|
173
|
+
simplecov-html (0.10.0)
|
164
174
|
slop (3.6.0)
|
165
|
-
sorcery (0.
|
175
|
+
sorcery (0.10.3)
|
166
176
|
bcrypt (~> 3.1)
|
167
177
|
oauth (~> 0.4, >= 0.4.4)
|
168
|
-
oauth2 (>= 0.8.0)
|
169
|
-
sprockets (3.7.
|
178
|
+
oauth2 (~> 1.0, >= 0.8.0)
|
179
|
+
sprockets (3.7.1)
|
170
180
|
concurrent-ruby (~> 1.0)
|
171
181
|
rack (> 1, < 3)
|
172
182
|
sprockets-rails (3.2.0)
|
173
183
|
actionpack (>= 4.0)
|
174
184
|
activesupport (>= 4.0)
|
175
185
|
sprockets (>= 3.0.0)
|
176
|
-
sqlite3 (1.3.
|
177
|
-
thor (0.19.
|
178
|
-
thread_safe (0.3.
|
179
|
-
tzinfo (1.2.
|
186
|
+
sqlite3 (1.3.13)
|
187
|
+
thor (0.19.4)
|
188
|
+
thread_safe (0.3.6)
|
189
|
+
tzinfo (1.2.3)
|
180
190
|
thread_safe (~> 0.1)
|
191
|
+
websocket-driver (0.6.5)
|
192
|
+
websocket-extensions (>= 0.1.0)
|
193
|
+
websocket-extensions (0.1.2)
|
181
194
|
xpath (2.0.0)
|
182
195
|
nokogiri (~> 1.3)
|
183
196
|
|
@@ -192,8 +205,9 @@ DEPENDENCIES
|
|
192
205
|
curupira!
|
193
206
|
factory_girl_rails
|
194
207
|
pry-rails
|
208
|
+
rails-controller-testing
|
195
209
|
rspec-rails
|
196
210
|
sqlite3
|
197
211
|
|
198
212
|
BUNDLED WITH
|
199
|
-
1.
|
213
|
+
1.13.6
|
data/curupira.gemspec
CHANGED
@@ -17,12 +17,12 @@ Gem::Specification.new do |s|
|
|
17
17
|
s.test_files = Dir["spec/**/*"]
|
18
18
|
s.require_paths = ["lib"]
|
19
19
|
|
20
|
-
s.add_dependency
|
21
|
-
s.add_dependency "sorcery"
|
22
|
-
s.add_dependency "cocoon"
|
23
|
-
s.add_dependency "jquery-rails"
|
20
|
+
s.add_dependency 'rails', '~> 5.1', '>= 5.1.0'
|
21
|
+
s.add_dependency "sorcery", '~> 0'
|
22
|
+
s.add_dependency "cocoon", '~> 0'
|
23
|
+
s.add_dependency "jquery-rails", '~> 0'
|
24
24
|
|
25
|
-
s.add_development_dependency 'rspec-rails'
|
26
|
-
s.add_development_dependency 'capybara'
|
27
|
-
s.add_development_dependency 'factory_girl_rails'
|
25
|
+
s.add_development_dependency 'rspec-rails', '~> 0'
|
26
|
+
s.add_development_dependency 'capybara', '~> 0'
|
27
|
+
s.add_development_dependency 'factory_girl_rails', '~> 0'
|
28
28
|
end
|
data/lib/curupira/version.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'rails_helper'
|
2
2
|
|
3
3
|
class BaseController < ApplicationController
|
4
|
-
|
4
|
+
before_action :authorize
|
5
5
|
end
|
6
6
|
|
7
7
|
describe BaseController, type: :controller do
|
@@ -34,7 +34,8 @@ describe BaseController, type: :controller do
|
|
34
34
|
context "when user have authorization" do
|
35
35
|
it "user access the resource" do
|
36
36
|
get :index
|
37
|
-
expect(
|
37
|
+
expect(response).to be_success
|
38
|
+
expect(response).to have_http_status(200)
|
38
39
|
end
|
39
40
|
end
|
40
41
|
end
|
@@ -29,12 +29,12 @@ describe Curupira::GroupsController do
|
|
29
29
|
|
30
30
|
context "when group exists" do
|
31
31
|
it "should get show" do
|
32
|
-
get :show, id: group
|
32
|
+
get :show, params: { id: group }
|
33
33
|
expect(response).to be_success
|
34
34
|
end
|
35
35
|
|
36
36
|
it "returns group" do
|
37
|
-
get :show, id: group
|
37
|
+
get :show, params: { id: group }
|
38
38
|
expect(assigns(:group)).to eql group
|
39
39
|
end
|
40
40
|
end
|
@@ -42,7 +42,7 @@ describe Curupira::GroupsController do
|
|
42
42
|
context "when group does not exist" do
|
43
43
|
it "renders 404" do
|
44
44
|
expect {
|
45
|
-
get :show, id: "wrong id"
|
45
|
+
get :show, params: { id: "wrong id" }
|
46
46
|
}.to raise_error ActiveRecord::RecordNotFound
|
47
47
|
end
|
48
48
|
end
|
@@ -65,12 +65,12 @@ describe Curupira::GroupsController do
|
|
65
65
|
|
66
66
|
context "when group exists" do
|
67
67
|
it "should get edit" do
|
68
|
-
get :edit, id: group
|
68
|
+
get :edit, params: { id: group }
|
69
69
|
expect(response).to be_success
|
70
70
|
end
|
71
71
|
|
72
72
|
it "returns group" do
|
73
|
-
get :edit, id: group
|
73
|
+
get :edit, params: { id: group }
|
74
74
|
expect(assigns(:group)).to eql group
|
75
75
|
end
|
76
76
|
end
|
@@ -78,7 +78,7 @@ describe Curupira::GroupsController do
|
|
78
78
|
context "when group does not exist" do
|
79
79
|
it "renders 404" do
|
80
80
|
expect {
|
81
|
-
get :edit, id: "wrong id"
|
81
|
+
get :edit, params: { id: "wrong id" }
|
82
82
|
}.to raise_error ActiveRecord::RecordNotFound
|
83
83
|
end
|
84
84
|
end
|
@@ -89,18 +89,18 @@ describe Curupira::GroupsController do
|
|
89
89
|
let(:params) { { name: "Group Name", active: false } }
|
90
90
|
|
91
91
|
it "should redirect to new group" do
|
92
|
-
post :create, group: params
|
92
|
+
post :create, params: { group: params }
|
93
93
|
expect(flash[:notice]).to eql "Grupo criado com sucesso"
|
94
94
|
end
|
95
95
|
|
96
96
|
it "should redirect to new group" do
|
97
|
-
post :create, group: params
|
97
|
+
post :create, params: { group: params }
|
98
98
|
expect(response).to redirect_to assigns(:group)
|
99
99
|
end
|
100
100
|
|
101
101
|
it "creates group" do
|
102
102
|
expect {
|
103
|
-
post :create, group: params
|
103
|
+
post :create, params: { group: params }
|
104
104
|
}.to change { Group.count }.by(1)
|
105
105
|
end
|
106
106
|
end
|
@@ -110,12 +110,12 @@ describe Curupira::GroupsController do
|
|
110
110
|
|
111
111
|
it "does not create group" do
|
112
112
|
expect {
|
113
|
-
post :create, group: params
|
113
|
+
post :create, params: { group: params }
|
114
114
|
}.to change { Group.count }.by(0)
|
115
115
|
end
|
116
116
|
|
117
117
|
it "should render new" do
|
118
|
-
post :create, group: params
|
118
|
+
post :create, params: { group: params }
|
119
119
|
expect(response).to render_template :new
|
120
120
|
end
|
121
121
|
end
|
@@ -128,17 +128,17 @@ describe Curupira::GroupsController do
|
|
128
128
|
let(:params) { { name: "New group name", active: false } }
|
129
129
|
|
130
130
|
it "sets flash message" do
|
131
|
-
put :update, id: group, group: params
|
131
|
+
put :update, params: { id: group, group: params }
|
132
132
|
expect(flash[:notice]).to eql "Grupo atualizado com sucesso"
|
133
133
|
end
|
134
134
|
|
135
135
|
it "redirects to group" do
|
136
|
-
put :update, id: group, group: params
|
136
|
+
put :update, params: { id: group, group: params }
|
137
137
|
expect(response).to redirect_to assigns(:group)
|
138
138
|
end
|
139
139
|
|
140
140
|
it "updates group" do
|
141
|
-
put :update, id: group, group: params
|
141
|
+
put :update, params: { id: group, group: params }
|
142
142
|
expect(assigns(:group).name).to eql "New group name"
|
143
143
|
expect(assigns(:group).active).to eql false
|
144
144
|
end
|
@@ -148,13 +148,13 @@ describe Curupira::GroupsController do
|
|
148
148
|
let(:params) { { name: "", active: false } }
|
149
149
|
|
150
150
|
it "does not create group" do
|
151
|
-
put :update, id: group, group: params
|
151
|
+
put :update, params: { id: group, group: params }
|
152
152
|
expect(assigns(:group).reload.name).to eql group.name
|
153
153
|
expect(assigns(:group).active).to eql true
|
154
154
|
end
|
155
155
|
|
156
156
|
it "should render edit" do
|
157
|
-
put :update, id: group, group: params
|
157
|
+
put :update, params: { id: group, group: params }
|
158
158
|
expect(response).to render_template :edit
|
159
159
|
end
|
160
160
|
end
|