fine_print 6.0.1 → 6.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -2
- data/lib/fine_print/action_controller/base.rb +3 -1
- data/lib/fine_print/version.rb +1 -1
- metadata +9 -169
- data/spec/controllers/contracts_controller_spec.rb +0 -222
- data/spec/controllers/home_controller_spec.rb +0 -27
- data/spec/controllers/signatures_controller_spec.rb +0 -68
- data/spec/dummy/Rakefile +0 -6
- data/spec/dummy/app/assets/config/manifest.js +0 -4
- data/spec/dummy/app/assets/javascripts/application.js +0 -15
- data/spec/dummy/app/assets/javascripts/cable.js +0 -13
- data/spec/dummy/app/assets/stylesheets/application.css +0 -15
- data/spec/dummy/app/channels/application_cable/channel.rb +0 -4
- data/spec/dummy/app/channels/application_cable/connection.rb +0 -4
- data/spec/dummy/app/controllers/application_controller.rb +0 -3
- data/spec/dummy/app/controllers/dummy_models_controller.rb +0 -2
- data/spec/dummy/app/helpers/application_helper.rb +0 -15
- data/spec/dummy/app/jobs/application_job.rb +0 -2
- data/spec/dummy/app/mailers/application_mailer.rb +0 -4
- data/spec/dummy/app/models/application_record.rb +0 -3
- data/spec/dummy/app/models/dummy_user.rb +0 -2
- data/spec/dummy/app/views/layouts/application.html.erb +0 -15
- data/spec/dummy/app/views/layouts/mailer.html.erb +0 -13
- data/spec/dummy/app/views/layouts/mailer.text.erb +0 -1
- data/spec/dummy/bin/bundle +0 -3
- data/spec/dummy/bin/rails +0 -4
- data/spec/dummy/bin/rake +0 -4
- data/spec/dummy/bin/setup +0 -36
- data/spec/dummy/bin/update +0 -31
- data/spec/dummy/bin/yarn +0 -11
- data/spec/dummy/config/application.rb +0 -25
- data/spec/dummy/config/boot.rb +0 -5
- data/spec/dummy/config/cable.yml +0 -10
- data/spec/dummy/config/database.yml +0 -25
- data/spec/dummy/config/environment.rb +0 -5
- data/spec/dummy/config/environments/development.rb +0 -61
- data/spec/dummy/config/environments/production.rb +0 -94
- data/spec/dummy/config/environments/test.rb +0 -46
- data/spec/dummy/config/initializers/application_controller_renderer.rb +0 -8
- data/spec/dummy/config/initializers/assets.rb +0 -14
- data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/dummy/config/initializers/content_security_policy.rb +0 -25
- data/spec/dummy/config/initializers/cookies_serializer.rb +0 -5
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +0 -4
- data/spec/dummy/config/initializers/fine_print.rb +0 -6
- data/spec/dummy/config/initializers/inflections.rb +0 -16
- data/spec/dummy/config/initializers/mime_types.rb +0 -4
- data/spec/dummy/config/initializers/wrap_parameters.rb +0 -14
- data/spec/dummy/config/locales/en.yml +0 -33
- data/spec/dummy/config/puma.rb +0 -34
- data/spec/dummy/config/routes.rb +0 -3
- data/spec/dummy/config/spring.rb +0 -6
- data/spec/dummy/config/storage.yml +0 -34
- data/spec/dummy/config.ru +0 -5
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/1000_create_dummy_users.rb +0 -9
- data/spec/dummy/db/schema.rb +0 -42
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +0 -95
- data/spec/dummy/log/test.log +0 -5352
- data/spec/dummy/package.json +0 -5
- data/spec/dummy/public/404.html +0 -67
- data/spec/dummy/public/422.html +0 -67
- data/spec/dummy/public/500.html +0 -66
- data/spec/dummy/public/apple-touch-icon-precomposed.png +0 -0
- data/spec/dummy/public/apple-touch-icon.png +0 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/tmp/development_secret.txt +0 -1
- data/spec/factories/fine_print/contract.rb +0 -26
- data/spec/factories/fine_print/signature.rb +0 -17
- data/spec/factories/user.rb +0 -4
- data/spec/lib/fine_print/action_controller/base_spec.rb +0 -30
- data/spec/lib/fine_print_spec.rb +0 -63
- data/spec/models/contract_spec.rb +0 -89
- data/spec/models/signature_spec.rb +0 -18
- data/spec/spec_helper.rb +0 -23
- data/spec/support/controller.rb +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 72f2646950df4fff3898887813e3b9a4cc55d038fe440379a3662c6e7f513e3f
|
4
|
+
data.tar.gz: 02ac6dad48bcf15824413c8df3bd1190c7f85f971209e74c1dd13d7ed0de9f05
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 776671c49a14cce4eff098d1b3d838154a99ee0b222da871b2409d82b69817a1cd38bb4859ab9f968fbafa875d93e269756cdd6143bc48c07df8b83d3c61a4c9
|
7
|
+
data.tar.gz: 7ed5cdbf08bd4162553f8da52a6b8e4349ad47a117211732207cf80ce0e024f2cb93f157c33d96f01bc8d0fb7a98ae6a271deb865d894df0df79e722a22f1e47
|
data/README.md
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
# FinePrint
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/fine_print.svg)](http://badge.fury.io/rb/fine_print)
|
4
|
-
[![
|
5
|
-
[![Coverage Status](https://coveralls.io/repos/lml/fine_print/badge.svg)](https://coveralls.io/r/lml/fine_print)
|
4
|
+
[![Tests](https://github.com/lml/fine_print/workflows/Tests/badge.svg)](https://github.com/lml/fine_print/actions?query=workflow:Tests)
|
6
5
|
[![Code Climate](https://codeclimate.com/github/lml/fine_print/badges/gpa.svg)](https://codeclimate.com/github/lml/fine_print)
|
7
6
|
|
8
7
|
FinePrint is a Rails engine in gem form that makes managing web site agreements
|
data/lib/fine_print/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fine_print
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.0.
|
4
|
+
version: 6.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- JP Slavinsky
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2025-01-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -71,16 +71,16 @@ dependencies:
|
|
71
71
|
name: sqlite3
|
72
72
|
requirement: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
|
-
- - "
|
74
|
+
- - "~>"
|
75
75
|
- !ruby/object:Gem::Version
|
76
|
-
version: '
|
76
|
+
version: '1.4'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
79
|
version_requirements: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
|
-
- - "
|
81
|
+
- - "~>"
|
82
82
|
- !ruby/object:Gem::Version
|
83
|
-
version: '
|
83
|
+
version: '1.4'
|
84
84
|
- !ruby/object:Gem::Dependency
|
85
85
|
name: rspec-rails
|
86
86
|
requirement: !ruby/object:Gem::Requirement
|
@@ -137,20 +137,6 @@ dependencies:
|
|
137
137
|
- - ">="
|
138
138
|
- !ruby/object:Gem::Version
|
139
139
|
version: '0'
|
140
|
-
- !ruby/object:Gem::Dependency
|
141
|
-
name: coveralls
|
142
|
-
requirement: !ruby/object:Gem::Requirement
|
143
|
-
requirements:
|
144
|
-
- - ">="
|
145
|
-
- !ruby/object:Gem::Version
|
146
|
-
version: '0'
|
147
|
-
type: :development
|
148
|
-
prerelease: false
|
149
|
-
version_requirements: !ruby/object:Gem::Requirement
|
150
|
-
requirements:
|
151
|
-
- - ">="
|
152
|
-
- !ruby/object:Gem::Version
|
153
|
-
version: '0'
|
154
140
|
description: FinePrint allows site admins to easily create, update and ask users to
|
155
141
|
sign site agreements, keeping a record of when users signed a certain version of
|
156
142
|
each agreement.
|
@@ -191,80 +177,7 @@ files:
|
|
191
177
|
- lib/fine_print/engine.rb
|
192
178
|
- lib/fine_print/version.rb
|
193
179
|
- lib/tasks/fine_print_tasks.rake
|
194
|
-
|
195
|
-
- spec/controllers/home_controller_spec.rb
|
196
|
-
- spec/controllers/signatures_controller_spec.rb
|
197
|
-
- spec/dummy/Rakefile
|
198
|
-
- spec/dummy/app/assets/config/manifest.js
|
199
|
-
- spec/dummy/app/assets/javascripts/application.js
|
200
|
-
- spec/dummy/app/assets/javascripts/cable.js
|
201
|
-
- spec/dummy/app/assets/stylesheets/application.css
|
202
|
-
- spec/dummy/app/channels/application_cable/channel.rb
|
203
|
-
- spec/dummy/app/channels/application_cable/connection.rb
|
204
|
-
- spec/dummy/app/controllers/application_controller.rb
|
205
|
-
- spec/dummy/app/controllers/dummy_models_controller.rb
|
206
|
-
- spec/dummy/app/helpers/application_helper.rb
|
207
|
-
- spec/dummy/app/jobs/application_job.rb
|
208
|
-
- spec/dummy/app/mailers/application_mailer.rb
|
209
|
-
- spec/dummy/app/models/application_record.rb
|
210
|
-
- spec/dummy/app/models/dummy_user.rb
|
211
|
-
- spec/dummy/app/views/layouts/application.html.erb
|
212
|
-
- spec/dummy/app/views/layouts/mailer.html.erb
|
213
|
-
- spec/dummy/app/views/layouts/mailer.text.erb
|
214
|
-
- spec/dummy/bin/bundle
|
215
|
-
- spec/dummy/bin/rails
|
216
|
-
- spec/dummy/bin/rake
|
217
|
-
- spec/dummy/bin/setup
|
218
|
-
- spec/dummy/bin/update
|
219
|
-
- spec/dummy/bin/yarn
|
220
|
-
- spec/dummy/config.ru
|
221
|
-
- spec/dummy/config/application.rb
|
222
|
-
- spec/dummy/config/boot.rb
|
223
|
-
- spec/dummy/config/cable.yml
|
224
|
-
- spec/dummy/config/database.yml
|
225
|
-
- spec/dummy/config/environment.rb
|
226
|
-
- spec/dummy/config/environments/development.rb
|
227
|
-
- spec/dummy/config/environments/production.rb
|
228
|
-
- spec/dummy/config/environments/test.rb
|
229
|
-
- spec/dummy/config/initializers/application_controller_renderer.rb
|
230
|
-
- spec/dummy/config/initializers/assets.rb
|
231
|
-
- spec/dummy/config/initializers/backtrace_silencers.rb
|
232
|
-
- spec/dummy/config/initializers/content_security_policy.rb
|
233
|
-
- spec/dummy/config/initializers/cookies_serializer.rb
|
234
|
-
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
235
|
-
- spec/dummy/config/initializers/fine_print.rb
|
236
|
-
- spec/dummy/config/initializers/inflections.rb
|
237
|
-
- spec/dummy/config/initializers/mime_types.rb
|
238
|
-
- spec/dummy/config/initializers/wrap_parameters.rb
|
239
|
-
- spec/dummy/config/locales/en.yml
|
240
|
-
- spec/dummy/config/puma.rb
|
241
|
-
- spec/dummy/config/routes.rb
|
242
|
-
- spec/dummy/config/spring.rb
|
243
|
-
- spec/dummy/config/storage.yml
|
244
|
-
- spec/dummy/db/development.sqlite3
|
245
|
-
- spec/dummy/db/migrate/1000_create_dummy_users.rb
|
246
|
-
- spec/dummy/db/schema.rb
|
247
|
-
- spec/dummy/db/test.sqlite3
|
248
|
-
- spec/dummy/log/development.log
|
249
|
-
- spec/dummy/log/test.log
|
250
|
-
- spec/dummy/package.json
|
251
|
-
- spec/dummy/public/404.html
|
252
|
-
- spec/dummy/public/422.html
|
253
|
-
- spec/dummy/public/500.html
|
254
|
-
- spec/dummy/public/apple-touch-icon-precomposed.png
|
255
|
-
- spec/dummy/public/apple-touch-icon.png
|
256
|
-
- spec/dummy/public/favicon.ico
|
257
|
-
- spec/dummy/tmp/development_secret.txt
|
258
|
-
- spec/factories/fine_print/contract.rb
|
259
|
-
- spec/factories/fine_print/signature.rb
|
260
|
-
- spec/factories/user.rb
|
261
|
-
- spec/lib/fine_print/action_controller/base_spec.rb
|
262
|
-
- spec/lib/fine_print_spec.rb
|
263
|
-
- spec/models/contract_spec.rb
|
264
|
-
- spec/models/signature_spec.rb
|
265
|
-
- spec/spec_helper.rb
|
266
|
-
- spec/support/controller.rb
|
267
|
-
homepage: http://github.com/lml/fine_print
|
180
|
+
homepage: https://github.com/openstax/fine_print
|
268
181
|
licenses:
|
269
182
|
- MIT
|
270
183
|
metadata: {}
|
@@ -283,81 +196,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
283
196
|
- !ruby/object:Gem::Version
|
284
197
|
version: '0'
|
285
198
|
requirements: []
|
286
|
-
rubygems_version: 3.
|
199
|
+
rubygems_version: 3.5.21
|
287
200
|
signing_key:
|
288
201
|
specification_version: 4
|
289
202
|
summary: Manages site agreements with versioning.
|
290
|
-
test_files:
|
291
|
-
- spec/spec_helper.rb
|
292
|
-
- spec/dummy/app/mailers/application_mailer.rb
|
293
|
-
- spec/dummy/app/models/dummy_user.rb
|
294
|
-
- spec/dummy/app/models/application_record.rb
|
295
|
-
- spec/dummy/app/jobs/application_job.rb
|
296
|
-
- spec/dummy/app/controllers/application_controller.rb
|
297
|
-
- spec/dummy/app/controllers/dummy_models_controller.rb
|
298
|
-
- spec/dummy/app/views/layouts/application.html.erb
|
299
|
-
- spec/dummy/app/views/layouts/mailer.html.erb
|
300
|
-
- spec/dummy/app/views/layouts/mailer.text.erb
|
301
|
-
- spec/dummy/app/assets/config/manifest.js
|
302
|
-
- spec/dummy/app/assets/javascripts/cable.js
|
303
|
-
- spec/dummy/app/assets/javascripts/application.js
|
304
|
-
- spec/dummy/app/assets/stylesheets/application.css
|
305
|
-
- spec/dummy/app/helpers/application_helper.rb
|
306
|
-
- spec/dummy/app/channels/application_cable/connection.rb
|
307
|
-
- spec/dummy/app/channels/application_cable/channel.rb
|
308
|
-
- spec/dummy/bin/update
|
309
|
-
- spec/dummy/bin/rake
|
310
|
-
- spec/dummy/bin/setup
|
311
|
-
- spec/dummy/bin/bundle
|
312
|
-
- spec/dummy/bin/yarn
|
313
|
-
- spec/dummy/bin/rails
|
314
|
-
- spec/dummy/config/routes.rb
|
315
|
-
- spec/dummy/config/locales/en.yml
|
316
|
-
- spec/dummy/config/cable.yml
|
317
|
-
- spec/dummy/config/environments/production.rb
|
318
|
-
- spec/dummy/config/environments/development.rb
|
319
|
-
- spec/dummy/config/environments/test.rb
|
320
|
-
- spec/dummy/config/spring.rb
|
321
|
-
- spec/dummy/config/environment.rb
|
322
|
-
- spec/dummy/config/storage.yml
|
323
|
-
- spec/dummy/config/application.rb
|
324
|
-
- spec/dummy/config/puma.rb
|
325
|
-
- spec/dummy/config/database.yml
|
326
|
-
- spec/dummy/config/boot.rb
|
327
|
-
- spec/dummy/config/initializers/application_controller_renderer.rb
|
328
|
-
- spec/dummy/config/initializers/backtrace_silencers.rb
|
329
|
-
- spec/dummy/config/initializers/mime_types.rb
|
330
|
-
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
331
|
-
- spec/dummy/config/initializers/wrap_parameters.rb
|
332
|
-
- spec/dummy/config/initializers/assets.rb
|
333
|
-
- spec/dummy/config/initializers/cookies_serializer.rb
|
334
|
-
- spec/dummy/config/initializers/content_security_policy.rb
|
335
|
-
- spec/dummy/config/initializers/inflections.rb
|
336
|
-
- spec/dummy/config/initializers/fine_print.rb
|
337
|
-
- spec/dummy/config.ru
|
338
|
-
- spec/dummy/Rakefile
|
339
|
-
- spec/dummy/public/favicon.ico
|
340
|
-
- spec/dummy/public/422.html
|
341
|
-
- spec/dummy/public/apple-touch-icon.png
|
342
|
-
- spec/dummy/public/500.html
|
343
|
-
- spec/dummy/public/404.html
|
344
|
-
- spec/dummy/public/apple-touch-icon-precomposed.png
|
345
|
-
- spec/dummy/package.json
|
346
|
-
- spec/dummy/db/schema.rb
|
347
|
-
- spec/dummy/db/test.sqlite3
|
348
|
-
- spec/dummy/db/migrate/1000_create_dummy_users.rb
|
349
|
-
- spec/dummy/db/development.sqlite3
|
350
|
-
- spec/dummy/log/test.log
|
351
|
-
- spec/dummy/log/development.log
|
352
|
-
- spec/dummy/tmp/development_secret.txt
|
353
|
-
- spec/models/signature_spec.rb
|
354
|
-
- spec/models/contract_spec.rb
|
355
|
-
- spec/support/controller.rb
|
356
|
-
- spec/factories/fine_print/signature.rb
|
357
|
-
- spec/factories/fine_print/contract.rb
|
358
|
-
- spec/factories/user.rb
|
359
|
-
- spec/lib/fine_print_spec.rb
|
360
|
-
- spec/lib/fine_print/action_controller/base_spec.rb
|
361
|
-
- spec/controllers/signatures_controller_spec.rb
|
362
|
-
- spec/controllers/contracts_controller_spec.rb
|
363
|
-
- spec/controllers/home_controller_spec.rb
|
203
|
+
test_files: []
|
@@ -1,222 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
module FinePrint
|
4
|
-
describe ContractsController, type: :controller do
|
5
|
-
routes { FinePrint::Engine.routes }
|
6
|
-
|
7
|
-
before(:each) do
|
8
|
-
setup_controller_spec
|
9
|
-
end
|
10
|
-
|
11
|
-
let!(:contract) { FactoryBot.create(:fine_print_contract) }
|
12
|
-
|
13
|
-
it "won't get index unless authorized" do
|
14
|
-
get :index
|
15
|
-
expect(response.status).to eq 403
|
16
|
-
|
17
|
-
sign_in @user
|
18
|
-
get :index
|
19
|
-
expect(response.status).to eq 403
|
20
|
-
end
|
21
|
-
|
22
|
-
it 'must get index if authorized' do
|
23
|
-
sign_in @admin
|
24
|
-
get :index
|
25
|
-
expect(response.status).to eq 200
|
26
|
-
end
|
27
|
-
|
28
|
-
it "won't get new unless authorized" do
|
29
|
-
get :new
|
30
|
-
expect(response.status).to eq 403
|
31
|
-
|
32
|
-
sign_in @user
|
33
|
-
get :new
|
34
|
-
expect(response.status).to eq 403
|
35
|
-
end
|
36
|
-
|
37
|
-
it 'must get new if authorized' do
|
38
|
-
sign_in @admin
|
39
|
-
get :new
|
40
|
-
expect(response.status).to eq 200
|
41
|
-
end
|
42
|
-
|
43
|
-
it "won't create unless authorized" do
|
44
|
-
attributes = Hash.new
|
45
|
-
attributes[:name] = 'some_name'
|
46
|
-
attributes[:title] = 'Some title'
|
47
|
-
attributes[:content] = 'Some content'
|
48
|
-
|
49
|
-
post :create, params: { contract: :attributes }
|
50
|
-
expect(response.status).to eq 403
|
51
|
-
expect(assigns(:contract)).to be_nil
|
52
|
-
|
53
|
-
sign_in @user
|
54
|
-
post :create, params: { contract: :attributes }
|
55
|
-
expect(response.status).to eq 403
|
56
|
-
expect(assigns(:contract)).to be_nil
|
57
|
-
end
|
58
|
-
|
59
|
-
it 'must create if authorized' do
|
60
|
-
sign_in @admin
|
61
|
-
attributes = Hash.new
|
62
|
-
attributes[:name] = 'some_name'
|
63
|
-
attributes[:title] = 'Some title'
|
64
|
-
attributes[:content] = 'Some content'
|
65
|
-
|
66
|
-
post :create, params: { contract: attributes }
|
67
|
-
expect(response).to redirect_to assigns(:contract)
|
68
|
-
expect(assigns(:contract).errors).to be_empty
|
69
|
-
expect(assigns(:contract).name).to eq 'some_name'
|
70
|
-
expect(assigns(:contract).title).to eq 'Some title'
|
71
|
-
expect(assigns(:contract).content).to eq 'Some content'
|
72
|
-
end
|
73
|
-
|
74
|
-
it "won't edit unless authorized" do
|
75
|
-
get :edit, params: { id: contract.id }
|
76
|
-
expect(response.status).to eq 403
|
77
|
-
|
78
|
-
sign_in @user
|
79
|
-
get :edit, params: { id: contract.id }
|
80
|
-
expect(response.status).to eq 403
|
81
|
-
end
|
82
|
-
|
83
|
-
it 'must edit if authorized' do
|
84
|
-
sign_in @admin
|
85
|
-
get :edit, params: { id: contract.id }
|
86
|
-
expect(response.status).to eq 200
|
87
|
-
end
|
88
|
-
|
89
|
-
it "won't update unless authorized" do
|
90
|
-
attributes = Hash.new
|
91
|
-
attributes[:name] = 'another_name'
|
92
|
-
attributes[:title] = 'Another title'
|
93
|
-
attributes[:content] = 'Another content'
|
94
|
-
name = contract.name
|
95
|
-
title = contract.title
|
96
|
-
content = contract.content
|
97
|
-
|
98
|
-
put :update, params: { id: contract.id, contract: attributes }
|
99
|
-
expect(response.status).to eq 403
|
100
|
-
contract.reload
|
101
|
-
expect(contract.name).to eq name
|
102
|
-
expect(contract.title).to eq title
|
103
|
-
expect(contract.content).to eq content
|
104
|
-
|
105
|
-
sign_in @user
|
106
|
-
put :update, params: { id: contract.id, contract: attributes }
|
107
|
-
expect(response.status).to eq 403
|
108
|
-
contract.reload
|
109
|
-
expect(contract.name).to eq name
|
110
|
-
expect(contract.title).to eq title
|
111
|
-
expect(contract.content).to eq content
|
112
|
-
end
|
113
|
-
|
114
|
-
it 'must update if authorized' do
|
115
|
-
attributes = Hash.new
|
116
|
-
attributes[:name] = 'another_name'
|
117
|
-
attributes[:title] = 'Another title'
|
118
|
-
attributes[:content] = 'Another content'
|
119
|
-
|
120
|
-
sign_in @admin
|
121
|
-
put :update, params: { id: contract.id, contract: attributes }
|
122
|
-
expect(response).to redirect_to contract
|
123
|
-
contract.reload
|
124
|
-
expect(contract.errors).to be_empty
|
125
|
-
expect(contract.name).to eq 'another_name'
|
126
|
-
expect(contract.title).to eq 'Another title'
|
127
|
-
expect(contract.content).to eq 'Another content'
|
128
|
-
end
|
129
|
-
|
130
|
-
it "won't destroy unless authorized" do
|
131
|
-
delete :destroy, params: { id: contract.id }
|
132
|
-
expect(response.status).to eq 403
|
133
|
-
expect(Contract.find(contract.id)).to eq contract
|
134
|
-
|
135
|
-
sign_in @user
|
136
|
-
delete :destroy, params: { id: contract.id }
|
137
|
-
expect(response.status).to eq 403
|
138
|
-
expect(Contract.find(contract.id)).to eq contract
|
139
|
-
end
|
140
|
-
|
141
|
-
it 'must destroy if authorized' do
|
142
|
-
sign_in @admin
|
143
|
-
delete :destroy, params: { id: contract.id }
|
144
|
-
expect(response).to redirect_to contracts_path
|
145
|
-
expect(Contract.find_by_id(contract.id)).to be_nil
|
146
|
-
end
|
147
|
-
|
148
|
-
it "won't publish unless authorized" do
|
149
|
-
expect(contract.is_published?).to eq false
|
150
|
-
put :publish, params: { id: contract.id }
|
151
|
-
expect(response.status).to eq 403
|
152
|
-
contract.reload
|
153
|
-
expect(contract.is_published?).to eq false
|
154
|
-
|
155
|
-
sign_in @user
|
156
|
-
put :publish, params: { id: contract.id }
|
157
|
-
expect(response.status).to eq 403
|
158
|
-
contract.reload
|
159
|
-
expect(contract.is_published?).to eq false
|
160
|
-
end
|
161
|
-
|
162
|
-
it 'must publish if authorized' do
|
163
|
-
expect(contract.is_published?).to eq false
|
164
|
-
sign_in @admin
|
165
|
-
|
166
|
-
put :publish, params: { id: contract.id }
|
167
|
-
expect(response).to redirect_to contracts_path
|
168
|
-
contract.reload
|
169
|
-
expect(contract.is_published?).to eq true
|
170
|
-
end
|
171
|
-
|
172
|
-
it "won't unpublish unless authorized" do
|
173
|
-
contract.publish
|
174
|
-
expect(contract.is_published?).to eq true
|
175
|
-
put :unpublish, params: { id: contract.id }
|
176
|
-
expect(response.status).to eq 403
|
177
|
-
contract.reload
|
178
|
-
expect(contract.is_published?).to eq true
|
179
|
-
|
180
|
-
sign_in @user
|
181
|
-
put :unpublish, params: { id: contract.id }
|
182
|
-
expect(response.status).to eq 403
|
183
|
-
contract.reload
|
184
|
-
expect(contract.is_published?).to eq true
|
185
|
-
end
|
186
|
-
|
187
|
-
it 'must unpublish if authorized' do
|
188
|
-
contract.publish
|
189
|
-
expect(contract.is_published?).to eq true
|
190
|
-
|
191
|
-
sign_in @admin
|
192
|
-
put :unpublish, params: { id: contract.id }
|
193
|
-
expect(response).to redirect_to contracts_path
|
194
|
-
contract.reload
|
195
|
-
expect(contract.is_published?).to eq false
|
196
|
-
end
|
197
|
-
|
198
|
-
it "won't create new_version unless authorized" do
|
199
|
-
contract.publish
|
200
|
-
expect(contract.is_published?).to eq true
|
201
|
-
|
202
|
-
post :new_version, params: { id: contract.id }
|
203
|
-
expect(response.status).to eq 403
|
204
|
-
expect(assigns(:contract)).to be_nil
|
205
|
-
|
206
|
-
sign_in @user
|
207
|
-
post :new_version, params: { id: contract.id }
|
208
|
-
expect(response.status).to eq 403
|
209
|
-
expect(assigns(:contract)).to be_nil
|
210
|
-
end
|
211
|
-
|
212
|
-
it 'must create new_version if authorized' do
|
213
|
-
contract.publish
|
214
|
-
expect(contract.is_published?).to eq true
|
215
|
-
|
216
|
-
sign_in @admin
|
217
|
-
post :new_version, params: { id: contract.id }
|
218
|
-
expect(response.status).to eq 200
|
219
|
-
expect(assigns(:contract)).not_to be_nil
|
220
|
-
end
|
221
|
-
end
|
222
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
module FinePrint
|
4
|
-
describe HomeController, type: :controller do
|
5
|
-
routes { FinePrint::Engine.routes }
|
6
|
-
|
7
|
-
before(:each) do
|
8
|
-
setup_controller_spec
|
9
|
-
end
|
10
|
-
|
11
|
-
it "won't get index unless authorized" do
|
12
|
-
get :index
|
13
|
-
expect(response.status).to eq 403
|
14
|
-
|
15
|
-
sign_in @user
|
16
|
-
get :index
|
17
|
-
expect(response.status).to eq 403
|
18
|
-
end
|
19
|
-
|
20
|
-
it 'must get index if authorized' do
|
21
|
-
sign_in @user
|
22
|
-
@user.is_admin = true
|
23
|
-
get :index
|
24
|
-
expect(response).to redirect_to contracts_path
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
@@ -1,68 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
module FinePrint
|
4
|
-
describe SignaturesController, type: :controller do
|
5
|
-
routes { FinePrint::Engine.routes }
|
6
|
-
|
7
|
-
before(:each) do
|
8
|
-
setup_controller_spec
|
9
|
-
end
|
10
|
-
|
11
|
-
let!(:signature) { FactoryBot.create(:fine_print_signature) }
|
12
|
-
|
13
|
-
it "won't get index unless authorized" do
|
14
|
-
get :index, params: { contract_id: signature.contract.id }
|
15
|
-
expect(response.status).to eq 403
|
16
|
-
|
17
|
-
sign_in @user
|
18
|
-
get :index, params: { contract_id: signature.contract.id }
|
19
|
-
expect(response.status).to eq 403
|
20
|
-
end
|
21
|
-
|
22
|
-
it 'must get index if authorized' do
|
23
|
-
sign_in @admin
|
24
|
-
get :index, params: { contract_id: signature.contract.id }
|
25
|
-
expect(response.status).to eq 200
|
26
|
-
end
|
27
|
-
|
28
|
-
it "won't get new unless signed in" do
|
29
|
-
get :new, params: { contract_id: signature.contract.id }
|
30
|
-
expect(response.status).to eq 401
|
31
|
-
end
|
32
|
-
|
33
|
-
it 'must get new if signed in' do
|
34
|
-
sign_in @user
|
35
|
-
get :new, params: { contract_id: signature.contract.id }
|
36
|
-
expect(response.status).to eq 200
|
37
|
-
end
|
38
|
-
|
39
|
-
it "won't create unless signed in" do
|
40
|
-
post :create, params: { contract_id: signature.contract.id }
|
41
|
-
expect(response.status).to eq 401
|
42
|
-
end
|
43
|
-
|
44
|
-
it 'must create if signed in' do
|
45
|
-
sign_in @user
|
46
|
-
get :new, params: { contract_id: signature.contract.id }
|
47
|
-
expect(response.status).to eq 200
|
48
|
-
end
|
49
|
-
|
50
|
-
it "won't destroy unless authorized" do
|
51
|
-
delete :destroy, params: { id: signature.id }
|
52
|
-
expect(response.status).to eq 403
|
53
|
-
expect(Signature.find(signature.id)).to eq signature
|
54
|
-
|
55
|
-
sign_in @user
|
56
|
-
delete :destroy, params: { id: signature.id }
|
57
|
-
expect(response.status).to eq 403
|
58
|
-
expect(Signature.find(signature.id)).to eq signature
|
59
|
-
end
|
60
|
-
|
61
|
-
it 'must destroy if authorized' do
|
62
|
-
sign_in @admin
|
63
|
-
delete :destroy, params: { id: signature.id }
|
64
|
-
expect(response).to redirect_to contract_signatures_path(signature.contract)
|
65
|
-
expect(Signature.find_by_id(signature.id)).to be_nil
|
66
|
-
end
|
67
|
-
end
|
68
|
-
end
|
data/spec/dummy/Rakefile
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
-
// listed below.
|
3
|
-
//
|
4
|
-
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
-
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
|
6
|
-
//
|
7
|
-
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
-
// compiled file. JavaScript code in this file should be added after the last require_* statement.
|
9
|
-
//
|
10
|
-
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
|
11
|
-
// about supported directives.
|
12
|
-
//
|
13
|
-
//= require rails-ujs
|
14
|
-
//= require activestorage
|
15
|
-
//= require_tree .
|
@@ -1,13 +0,0 @@
|
|
1
|
-
// Action Cable provides the framework to deal with WebSockets in Rails.
|
2
|
-
// You can generate new channels where WebSocket features live using the `rails generate channel` command.
|
3
|
-
//
|
4
|
-
//= require action_cable
|
5
|
-
//= require_self
|
6
|
-
//= require_tree ./channels
|
7
|
-
|
8
|
-
(function() {
|
9
|
-
this.App || (this.App = {});
|
10
|
-
|
11
|
-
App.cable = ActionCable.createConsumer();
|
12
|
-
|
13
|
-
}).call(this);
|
@@ -1,15 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
-
* listed below.
|
4
|
-
*
|
5
|
-
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
-
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
|
7
|
-
*
|
8
|
-
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
-
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
|
10
|
-
* files in this directory. Styles in this file should be added after the last require_* statement.
|
11
|
-
* It is generally better to create a new file per style scope.
|
12
|
-
*
|
13
|
-
*= require_tree .
|
14
|
-
*= require_self
|
15
|
-
*/
|