has_moderated 1.0.beta → 1.0.beta2
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.
- data/README.rdoc +13 -0
- data/lib/has_moderated/moderated_attributes.rb +4 -2
- data/lib/has_moderated/moderation_model.rb +4 -0
- data/lib/has_moderated/version.rb +1 -1
- data/test/dummy/log/development.log +13 -0
- data/test/dummy/log/test.log +1841 -0
- data/test/dummy/spec/models/task_spec.rb +17 -0
- metadata +3 -2
@@ -522,4 +522,21 @@ describe Task do
|
|
522
522
|
Moderation.last.data.should eq("Test!")
|
523
523
|
end
|
524
524
|
end
|
525
|
+
|
526
|
+
context "preview:" do
|
527
|
+
before do
|
528
|
+
Object.send(:remove_const, 'Task')
|
529
|
+
load 'task.rb'
|
530
|
+
Task.has_moderated :title
|
531
|
+
end
|
532
|
+
|
533
|
+
it "shows a preview of changed attributes" do
|
534
|
+
Task.create! :title => "Task 1"
|
535
|
+
Task.last.title.should be_blank
|
536
|
+
|
537
|
+
preview = Moderation.last.preview
|
538
|
+
preview.title.should eq("Task 1")
|
539
|
+
preview.id.should eq(Task.last.id)
|
540
|
+
end
|
541
|
+
end
|
525
542
|
end
|
metadata
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: has_moderated
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 62196295
|
5
5
|
prerelease: 4
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
9
|
- beta
|
10
|
-
|
10
|
+
- 2
|
11
|
+
version: 1.0.beta2
|
11
12
|
platform: ruby
|
12
13
|
authors:
|
13
14
|
- Jan Berdajs
|