aboutsummaryrefslogtreecommitdiffstats
path: root/spec/models/referential_spec.rb
diff options
context:
space:
mode:
authorZog2018-04-18 09:59:15 +0200
committerJohan Van Ryseghem2018-04-27 11:17:19 +0200
commit0046e5a01cb08c10118b01c50f3c52d159854ef0 (patch)
tree6e690461a9266716d31f14611235eab9f1f76e33 /spec/models/referential_spec.rb
parent681f874e3150c35b03e74b25827b74791ae9ae95 (diff)
downloadchouette-core-0046e5a01cb08c10118b01c50f3c52d159854ef0.tar.bz2
Refs #6572; Use new states
Diffstat (limited to 'spec/models/referential_spec.rb')
-rw-r--r--spec/models/referential_spec.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/models/referential_spec.rb b/spec/models/referential_spec.rb
index 2fb8b5cb0..220201d37 100644
--- a/spec/models/referential_spec.rb
+++ b/spec/models/referential_spec.rb
@@ -73,6 +73,26 @@ describe Referential, :type => :model do
expect(Referential.archived).to include referential
end
end
+
+ context 'pending_while' do
+ it "should preserve the state" do
+ referential = create :referential
+ referential.archived!
+ expect(referential.state).to eq :archived
+ referential.pending_while do
+ expect(referential.state).to eq :pending
+ end
+ expect(referential.state).to eq :archived
+ begin
+ referential.pending_while do
+ expect(referential.state).to eq :pending
+ raise
+ end
+ rescue
+ end
+ expect(referential.state).to eq :archived
+ end
+ end
end
context ".referential_ids_in_periode" do