has_moderated 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -678,6 +678,38 @@ describe Task do
678
678
  end
679
679
  end
680
680
 
681
+ context "without_moderation:" do
682
+ before do
683
+ reload_models.task {
684
+ has_moderated :title
685
+ }
686
+ end
687
+
688
+ it "can bypass moderation for specific model" do
689
+ Task.create!
690
+ Moderation.count.should eq(0)
691
+ t = Task.first
692
+ t.title = "Task 2"
693
+ t.without_moderation do
694
+ t.save
695
+ end
696
+ Moderation.count.should eq(0)
697
+ Task.first.title.should eq("Task 2")
698
+ end
699
+
700
+ it "can bypass moderation for all models" do
701
+ Task.create!
702
+ Moderation.count.should eq(0)
703
+ t = Task.first
704
+ t.title = "Task 2"
705
+ Moderation.without_moderation do
706
+ t.save
707
+ end
708
+ Moderation.count.should eq(0)
709
+ Task.first.title.should eq("Task 2")
710
+ end
711
+ end
712
+
681
713
  context "preview:" do
682
714
  it "shows a live preview of changed attributes" do
683
715
  reload_models.task {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: has_moderated
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-14 00:00:00.000000000 Z
12
+ date: 2012-10-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -262,7 +262,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
262
262
  version: '0'
263
263
  segments:
264
264
  - 0
265
- hash: -753026751714852307
265
+ hash: -4025601991199858940
266
266
  required_rubygems_version: !ruby/object:Gem::Requirement
267
267
  none: false
268
268
  requirements:
@@ -271,7 +271,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
271
271
  version: '0'
272
272
  segments:
273
273
  - 0
274
- hash: -753026751714852307
274
+ hash: -4025601991199858940
275
275
  requirements: []
276
276
  rubyforge_project:
277
277
  rubygems_version: 1.8.24