track_changes 1.0.0.pre3 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +27 -0
- data/VERSION.yml +1 -1
- data/lib/track_changes/action_controller.rb +24 -24
- data/lib/track_changes/active_record.rb +13 -19
- data/lib/track_changes/{around_save.rb → around_update.rb} +2 -2
- data/lib/track_changes/changes.rb +2 -0
- data/lib/track_changes/current_user_filter.rb +1 -1
- data/lib/track_changes.rb +1 -1
- data/test/action_controller_test.rb +74 -0
- data/test/current_user_test.rb +15 -0
- data/test/functional/posts_controller_test.rb +1 -1
- data/test/railsapp/Gemfile +1 -1
- data/test/railsapp/Gemfile.lock +4 -4
- data/test/railsapp/db/test.sqlite3 +0 -0
- data/test/railsapp/log/test.log +2335 -3901
- data/test/track_changes_test.rb +9 -1
- metadata +11 -10
data/test/track_changes_test.rb
CHANGED
@@ -28,7 +28,15 @@ class TrackChangesTest < Test::Unit::TestCase
|
|
28
28
|
audit = post.audits.desc.first
|
29
29
|
expected_change = {"title" => ["Test Post", "Title Changed"]}
|
30
30
|
|
31
|
-
assert_equal
|
31
|
+
assert_equal 1, post.audits.count
|
32
32
|
assert_equal expected_change, audit.change_set
|
33
33
|
end
|
34
|
+
|
35
|
+
def test_should_not_audit_creation
|
36
|
+
old_count = Audit.count
|
37
|
+
User.create!(:name => "John Public")
|
38
|
+
Post.create!(:title => "Test Post", :body => "Hello, world!")
|
39
|
+
|
40
|
+
assert_equal old_count, Audit.count, Audit.all.map {|a| a.change_set.inspect }.join(" ")
|
41
|
+
end
|
34
42
|
end
|
metadata
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: track_changes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
4
|
+
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
|
10
|
-
version: 1.0.0.pre3
|
9
|
+
version: 1.0.0
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
12
|
- Matt Haley
|
@@ -15,7 +14,7 @@ autorequire:
|
|
15
14
|
bindir: bin
|
16
15
|
cert_chain: []
|
17
16
|
|
18
|
-
date: 2010-
|
17
|
+
date: 2010-09-02 00:00:00 -07:00
|
19
18
|
default_executable:
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
@@ -84,12 +83,14 @@ files:
|
|
84
83
|
- lib/track_changes.rb
|
85
84
|
- lib/track_changes/action_controller.rb
|
86
85
|
- lib/track_changes/active_record.rb
|
87
|
-
- lib/track_changes/
|
86
|
+
- lib/track_changes/around_update.rb
|
88
87
|
- lib/track_changes/changes.rb
|
89
88
|
- lib/track_changes/configuration.rb
|
90
89
|
- lib/track_changes/current_user.rb
|
91
90
|
- lib/track_changes/current_user_filter.rb
|
92
91
|
- lib/track_changes/engine.rb
|
92
|
+
- test/action_controller_test.rb
|
93
|
+
- test/current_user_test.rb
|
93
94
|
- test/functional/posts_controller_test.rb
|
94
95
|
- test/railsapp/Gemfile
|
95
96
|
- test/railsapp/Gemfile.lock
|
@@ -137,13 +138,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
137
138
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
138
139
|
none: false
|
139
140
|
requirements:
|
140
|
-
- - "
|
141
|
+
- - ">="
|
141
142
|
- !ruby/object:Gem::Version
|
142
143
|
segments:
|
143
|
-
-
|
144
|
-
|
145
|
-
- 1
|
146
|
-
version: 1.3.1
|
144
|
+
- 0
|
145
|
+
version: "0"
|
147
146
|
requirements: []
|
148
147
|
|
149
148
|
rubyforge_project: mhaley
|
@@ -152,6 +151,8 @@ signing_key:
|
|
152
151
|
specification_version: 3
|
153
152
|
summary: Easier auditing of Rails model changes in your controllers.
|
154
153
|
test_files:
|
154
|
+
- test/action_controller_test.rb
|
155
|
+
- test/current_user_test.rb
|
155
156
|
- test/schema.rb
|
156
157
|
- test/test_helper.rb
|
157
158
|
- test/track_changes_test.rb
|