paper_trail_scrapbook 0.1.9 → 0.1.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.circleci/config.yml +52 -0
- data/.rubocop.yml +2 -1
- data/.ruby-version +1 -0
- data/Changelog.md +2 -2
- data/Gemfile +2 -0
- data/Gemfile.lock +5 -2
- data/Rakefile +2 -0
- data/lib/paper_trail_scrapbook.rb +2 -4
- data/lib/paper_trail_scrapbook/changes.rb +21 -21
- data/lib/paper_trail_scrapbook/chapter.rb +2 -0
- data/lib/paper_trail_scrapbook/config.rb +4 -2
- data/lib/paper_trail_scrapbook/journal_entry.rb +2 -0
- data/lib/paper_trail_scrapbook/life_history.rb +2 -0
- data/lib/paper_trail_scrapbook/secondary_chapter.rb +2 -0
- data/lib/paper_trail_scrapbook/user_journal.rb +2 -0
- data/lib/paper_trail_scrapbook/version.rb +3 -1
- data/lib/paper_trail_scrapbook/version_helpers.rb +2 -0
- data/paper_trail_scrapbook.gemspec +5 -2
- data/spec/dummy_app/Rakefile +3 -1
- data/spec/dummy_app/app/models/animal.rb +2 -0
- data/spec/dummy_app/app/models/article.rb +2 -0
- data/spec/dummy_app/app/models/authorship.rb +2 -0
- data/spec/dummy_app/app/models/bar_habtm.rb +2 -0
- data/spec/dummy_app/app/models/book.rb +2 -0
- data/spec/dummy_app/app/models/boolit.rb +2 -0
- data/spec/dummy_app/app/models/callback_modifier.rb +2 -0
- data/spec/dummy_app/app/models/car.rb +2 -0
- data/spec/dummy_app/app/models/cat.rb +2 -0
- data/spec/dummy_app/app/models/chapter.rb +2 -0
- data/spec/dummy_app/app/models/citation.rb +2 -0
- data/spec/dummy_app/app/models/custom_primary_key_record.rb +2 -0
- data/spec/dummy_app/app/models/customer.rb +2 -0
- data/spec/dummy_app/app/models/document.rb +2 -0
- data/spec/dummy_app/app/models/dog.rb +2 -0
- data/spec/dummy_app/app/models/editor.rb +2 -0
- data/spec/dummy_app/app/models/editorship.rb +2 -0
- data/spec/dummy_app/app/models/elephant.rb +2 -0
- data/spec/dummy_app/app/models/fluxor.rb +2 -0
- data/spec/dummy_app/app/models/foo_habtm.rb +2 -0
- data/spec/dummy_app/app/models/foo_widget.rb +2 -0
- data/spec/dummy_app/app/models/fruit.rb +2 -0
- data/spec/dummy_app/app/models/gadget.rb +2 -0
- data/spec/dummy_app/app/models/kitchen/banana.rb +2 -0
- data/spec/dummy_app/app/models/legacy_widget.rb +2 -0
- data/spec/dummy_app/app/models/line_item.rb +2 -0
- data/spec/dummy_app/app/models/not_on_update.rb +2 -0
- data/spec/dummy_app/app/models/on/create.rb +2 -0
- data/spec/dummy_app/app/models/on/destroy.rb +2 -0
- data/spec/dummy_app/app/models/on/empty_array.rb +2 -0
- data/spec/dummy_app/app/models/on/update.rb +2 -0
- data/spec/dummy_app/app/models/order.rb +2 -0
- data/spec/dummy_app/app/models/paragraph.rb +2 -0
- data/spec/dummy_app/app/models/person.rb +2 -0
- data/spec/dummy_app/app/models/post.rb +2 -0
- data/spec/dummy_app/app/models/post_with_status.rb +2 -0
- data/spec/dummy_app/app/models/quotation.rb +2 -0
- data/spec/dummy_app/app/models/section.rb +2 -0
- data/spec/dummy_app/app/models/skipper.rb +2 -0
- data/spec/dummy_app/app/models/song.rb +2 -0
- data/spec/dummy_app/app/models/thing.rb +2 -0
- data/spec/dummy_app/app/models/translation.rb +2 -0
- data/spec/dummy_app/app/models/truck.rb +2 -0
- data/spec/dummy_app/app/models/vehicle.rb +2 -0
- data/spec/dummy_app/app/models/whatchamajigger.rb +2 -0
- data/spec/dummy_app/app/models/widget.rb +3 -1
- data/spec/dummy_app/app/models/wotsit.rb +2 -0
- data/spec/dummy_app/app/versions/custom_primary_key_record_version.rb +2 -0
- data/spec/dummy_app/app/versions/joined_version.rb +2 -0
- data/spec/dummy_app/app/versions/json_version.rb +2 -0
- data/spec/dummy_app/app/versions/kitchen/banana_version.rb +2 -0
- data/spec/dummy_app/app/versions/post_version.rb +2 -0
- data/spec/dummy_app/config.ru +2 -0
- data/spec/dummy_app/config/application.rb +3 -1
- data/spec/dummy_app/config/boot.rb +4 -2
- data/spec/dummy_app/config/environment.rb +3 -1
- data/spec/dummy_app/config/environments/development.rb +2 -0
- data/spec/dummy_app/config/environments/production.rb +2 -0
- data/spec/dummy_app/config/environments/test.rb +2 -0
- data/spec/dummy_app/config/initializers/backtrace_silencers.rb +2 -0
- data/spec/dummy_app/config/initializers/inflections.rb +2 -0
- data/spec/dummy_app/config/initializers/mime_types.rb +2 -0
- data/spec/dummy_app/config/initializers/paper_trail.rb +2 -0
- data/spec/dummy_app/config/initializers/secret_token.rb +2 -0
- data/spec/dummy_app/config/initializers/session_store.rb +2 -0
- data/spec/dummy_app/config/routes.rb +2 -0
- data/spec/paper_trail_scrapbook/changes_spec.rb +2 -0
- data/spec/paper_trail_scrapbook/chapter_spec.rb +2 -0
- data/spec/paper_trail_scrapbook/config_spec.rb +2 -0
- data/spec/paper_trail_scrapbook/life_history_spec.rb +8 -6
- data/spec/paper_trail_scrapbook/secondary_chapter_spec.rb +2 -0
- data/spec/paper_trail_scrapbook/user_journal_spec.rb +47 -43
- data/spec/paper_trail_scrapbook/version_helpers_spec.rb +9 -7
- data/spec/paper_trail_scrapbook/version_spec.rb +2 -0
- data/spec/paper_trail_scrapbook_spec.rb +2 -0
- data/spec/spec_helper.rb +3 -1
- metadata +20 -5
- data/circle.yml +0 -22
data/spec/dummy_app/config.ru
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'rubygems'
|
2
4
|
|
3
5
|
# We normally use the root project Gemfile (and gemspec), but when we run rake
|
@@ -12,7 +14,7 @@ require 'rubygems'
|
|
12
14
|
# we should keep the ability to specify BUNDLE_GEMFILE because the same
|
13
15
|
# situation could come up in the future.
|
14
16
|
unless ENV.key?('BUNDLE_GEMFILE')
|
15
|
-
gemfile = File.expand_path('
|
17
|
+
gemfile = File.expand_path('../../../Gemfile', __dir__)
|
16
18
|
if File.exist?(gemfile)
|
17
19
|
puts "Booting PT test dummy app: Using gemfile: #{gemfile}"
|
18
20
|
ENV['BUNDLE_GEMFILE'] = gemfile
|
@@ -21,4 +23,4 @@ end
|
|
21
23
|
require 'bundler'
|
22
24
|
Bundler.setup
|
23
25
|
|
24
|
-
$LOAD_PATH.unshift(File.expand_path('
|
26
|
+
$LOAD_PATH.unshift(File.expand_path('../../../lib', __dir__))
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'spec_helper'
|
2
4
|
|
3
5
|
module PaperTrailScrapbook
|
@@ -7,7 +9,7 @@ module PaperTrailScrapbook
|
|
7
9
|
PaperTrail.request.whodunnit = person.id
|
8
10
|
end
|
9
11
|
|
10
|
-
let(:person) {Person.create(name: 'The Tim Man')}
|
12
|
+
let(:person) { Person.create(name: 'The Tim Man') }
|
11
13
|
|
12
14
|
let(:book) do
|
13
15
|
b = Book.new(title: 'How the Grinch stole Xmas')
|
@@ -27,8 +29,8 @@ module PaperTrailScrapbook
|
|
27
29
|
a
|
28
30
|
end
|
29
31
|
|
30
|
-
let(:object) {described_class.new(target)}
|
31
|
-
let(:subject) {object.story}
|
32
|
+
let(:object) { described_class.new(target) }
|
33
|
+
let(:subject) { object.story }
|
32
34
|
|
33
35
|
describe '#story' do
|
34
36
|
it 'provides a whole story' do
|
@@ -56,7 +58,7 @@ module PaperTrailScrapbook
|
|
56
58
|
target.save!
|
57
59
|
|
58
60
|
expect(subject)
|
59
|
-
|
61
|
+
.to match(/How the Grinch stole Xmas\[\d+\] was \*removed\*/)
|
60
62
|
end
|
61
63
|
|
62
64
|
context 'it handles missing whodunnit record' do
|
@@ -66,7 +68,7 @@ module PaperTrailScrapbook
|
|
66
68
|
person.destroy
|
67
69
|
|
68
70
|
expect(subject)
|
69
|
-
|
71
|
+
.to match(/\*missing \(#{pid}\)\* created the following/)
|
70
72
|
end
|
71
73
|
end
|
72
74
|
|
@@ -74,7 +76,7 @@ module PaperTrailScrapbook
|
|
74
76
|
it 'allows for a custom invalid_whodunnit handler' do
|
75
77
|
config = PaperTrailScrapbook.config
|
76
78
|
handler = config.invalid_whodunnit
|
77
|
-
config.invalid_whodunnit = proc {|w| "*WHO (#{w})*"}
|
79
|
+
config.invalid_whodunnit = proc { |w| "*WHO (#{w})*" }
|
78
80
|
|
79
81
|
target
|
80
82
|
pid = person.id
|