spec/unit/identifier_spec.rb in ezid-client-0.4.2 vs spec/unit/identifier_spec.rb in ezid-client-0.5.0
- old
+ new
@@ -181,7 +181,28 @@
end
end
end
end
+ describe "boolean status methods" do
+ context "when the status is 'public'" do
+ before { allow(subject.metadata).to receive(:status) { Identifier::PUBLIC } }
+ it { is_expected.to be_public }
+ it { is_expected.not_to be_reserved }
+ it { is_expected.not_to be_unavailable }
+ end
+ context "when the status is 'reserved'" do
+ before { allow(subject.metadata).to receive(:status) { Identifier::RESERVED } }
+ it { is_expected.not_to be_public }
+ it { is_expected.to be_reserved }
+ it { is_expected.not_to be_unavailable }
+ end
+ context "when the status is 'unavailable'" do
+ before { allow(subject.metadata).to receive(:status) { Identifier::UNAVAILABLE } }
+ it { is_expected.not_to be_public }
+ it { is_expected.not_to be_reserved }
+ it { is_expected.to be_unavailable }
+ end
+ end
+
end
end