curupira 0.1.4 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: eb29f068e6f4690afe2f64cf6587fd838f184c06
4
- data.tar.gz: 0190a4567118d2378326c2a8b3e63e867012d648
3
+ metadata.gz: 3b6a39dad23eab614842b91636087476be703f33
4
+ data.tar.gz: 72cd15719e81d0e3b33e7198e289803f4c389e07
5
5
  SHA512:
6
- metadata.gz: 77124ff40f7f18dd59ad0ea3f61877334ac56d58420ac1cb1d71b213987a0b7cb3ba2e77dabcb514a33d6f2df7b9ca3670303b6be879782a4f5dc1720ea5a8d3
7
- data.tar.gz: f1e03c952fd4de4338a27990c6a33562398fec2d4a66d24fa05f8107429f2033bb9b6eb9ec34d2b73fd159cddba784e816a0e634d4e285ccdcdf2287c853070e
6
+ metadata.gz: 5957098b830e7aca577eb799e2f93ec00fd4a36af636f02decdc8275cd65e4d96ce74de13ba2ba9810b4b42de593cd4f4b4911993b6ff2d3316bfd5f81bd37da
7
+ data.tar.gz: bee394fdcf33526336e02d34eb97c669368e2507eb75e260d886db473a53a3880205a21fadac341f66d5738dd6acc1cf6c3588f81c769f0a184614de06828e63
data/Gemfile CHANGED
@@ -10,6 +10,7 @@ end
10
10
  group :test do
11
11
  gem 'ammeter'
12
12
  gem 'codeclimate-test-reporter', require: nil
13
+ gem 'rails-controller-testing'
13
14
  end
14
15
 
15
16
  platforms :ruby do
data/Gemfile.lock CHANGED
@@ -1,183 +1,196 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- curupira (0.1.4)
4
+ curupira (0.1.6)
5
5
  cocoon
6
6
  jquery-rails
7
- rails (~> 4.2.3)
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
- actionmailer (4.2.3)
14
- actionpack (= 4.2.3)
15
- actionview (= 4.2.3)
16
- activejob (= 4.2.3)
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 (~> 1.0, >= 1.0.5)
19
- actionpack (4.2.3)
20
- actionview (= 4.2.3)
21
- activesupport (= 4.2.3)
22
- rack (~> 1.6)
23
- rack-test (~> 0.6.2)
24
- rails-dom-testing (~> 1.0, >= 1.0.5)
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 (4.2.3)
27
- activesupport (= 4.2.3)
30
+ actionview (5.1.0)
31
+ activesupport (= 5.1.0)
28
32
  builder (~> 3.1)
29
- erubis (~> 2.7.0)
30
- rails-dom-testing (~> 1.0, >= 1.0.5)
31
- rails-html-sanitizer (~> 1.0, >= 1.0.2)
32
- activejob (4.2.3)
33
- activesupport (= 4.2.3)
34
- globalid (>= 0.3.0)
35
- activemodel (4.2.3)
36
- activesupport (= 4.2.3)
37
- builder (~> 3.1)
38
- activerecord (4.2.3)
39
- activemodel (= 4.2.3)
40
- activesupport (= 4.2.3)
41
- arel (~> 6.0)
42
- activesupport (4.2.3)
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
- ammeter (1.1.2)
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 (6.0.3)
56
+ arel (8.0.0)
53
57
  bcrypt (3.1.11)
54
- builder (3.2.2)
55
- byebug (4.0.5)
56
- columnize (= 0.9.0)
57
- capybara (2.4.4)
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.4.7)
65
- simplecov (>= 0.7.1, < 1.0.0)
66
- coderay (1.1.0)
67
- columnize (0.9.0)
68
- concurrent-ruby (1.0.2)
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
- erubis (2.7.0)
72
- factory_girl (4.5.0)
74
+ erubi (1.6.0)
75
+ factory_girl (4.8.0)
73
76
  activesupport (>= 3.0.0)
74
- factory_girl_rails (4.5.0)
75
- factory_girl (~> 4.5.0)
77
+ factory_girl_rails (4.8.0)
78
+ factory_girl (~> 4.8.0)
76
79
  railties (>= 3.0.0)
77
- faraday (0.9.2)
80
+ faraday (0.11.0)
78
81
  multipart-post (>= 1.2, < 3)
79
- globalid (0.3.7)
80
- activesupport (>= 4.1.0)
81
- i18n (0.7.0)
82
- jquery-rails (4.2.1)
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.8.3)
87
- jwt (1.5.4)
88
- loofah (2.0.2)
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.4)
93
+ mail (2.6.5)
91
94
  mime-types (>= 1.16, < 4)
92
95
  method_source (0.8.2)
93
- mime-types (2.6.1)
94
- mini_portile (0.6.2)
95
- minitest (5.8.0)
96
- multi_json (1.11.2)
97
- multi_xml (0.5.5)
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
- nokogiri (1.6.6.2)
100
- mini_portile (~> 0.6.0)
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.2.0)
103
- faraday (>= 0.8, < 0.10)
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.1)
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.4)
113
- pry (>= 0.9.10)
114
- rack (1.6.4)
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 (4.2.3)
118
- actionmailer (= 4.2.3)
119
- actionpack (= 4.2.3)
120
- actionview (= 4.2.3)
121
- activejob (= 4.2.3)
122
- activemodel (= 4.2.3)
123
- activerecord (= 4.2.3)
124
- activesupport (= 4.2.3)
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 (= 4.2.3)
127
- sprockets-rails
128
- rails-deprecated_sanitizer (1.0.3)
129
- activesupport (>= 4.2.0.alpha)
130
- rails-dom-testing (1.0.6)
131
- activesupport (>= 4.2.0.beta, < 5.0)
132
- nokogiri (~> 1.6.0)
133
- rails-deprecated_sanitizer (>= 1.0.1)
134
- rails-html-sanitizer (1.0.2)
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 (4.2.3)
137
- actionpack (= 4.2.3)
138
- activesupport (= 4.2.3)
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 (10.4.2)
142
- rspec-core (3.2.3)
143
- rspec-support (~> 3.2.0)
144
- rspec-expectations (3.2.1)
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.2.0)
147
- rspec-mocks (3.2.1)
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.2.0)
150
- rspec-rails (3.2.1)
151
- actionpack (>= 3.0, < 4.3)
152
- activesupport (>= 3.0, < 4.3)
153
- railties (>= 3.0, < 4.3)
154
- rspec-core (~> 3.2.0)
155
- rspec-expectations (~> 3.2.0)
156
- rspec-mocks (~> 3.2.0)
157
- rspec-support (~> 3.2.0)
158
- rspec-support (3.2.2)
159
- simplecov (0.9.2)
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
- multi_json (~> 1.0)
162
- simplecov-html (~> 0.9.0)
163
- simplecov-html (0.9.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.9.1)
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.0)
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.10)
177
- thor (0.19.1)
178
- thread_safe (0.3.5)
179
- tzinfo (1.2.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.11.2
213
+ 1.13.6
@@ -1,5 +1,5 @@
1
1
  class Curupira::AuthorizedController < ApplicationController
2
- before_filter :require_login
2
+ before_action :require_login
3
3
 
4
4
  private
5
5
 
@@ -1,5 +1,5 @@
1
1
  class Curupira::PasswordsController < ApplicationController
2
- before_filter :redirect_to_root_with_errors, if: :current_user
2
+ before_action :redirect_to_root_with_errors, if: :current_user
3
3
 
4
4
  def new
5
5
  @user = User.new
@@ -1,5 +1,5 @@
1
1
  class Curupira::SessionsController < ActionController::Base
2
- before_filter :redirect_to_root_with_errors, if: :current_user, except: :destroy
2
+ before_action :redirect_to_root_with_errors, if: :current_user, except: :destroy
3
3
 
4
4
  def new
5
5
  @user = User.new
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 "rails", "~> 4.2.3"
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
@@ -1,3 +1,3 @@
1
1
  module Curupira
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.6"
3
3
  end
@@ -1,7 +1,7 @@
1
1
  require 'rails_helper'
2
2
 
3
3
  class BaseController < ApplicationController
4
- before_filter :authorize
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(assigns(:success)).to be true
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