spec/unit/identifier_spec.rb in ezid-client-0.7.0 vs spec/unit/identifier_spec.rb in ezid-client-0.8.0
- old
+ new
@@ -1,11 +1,11 @@
module Ezid
RSpec.describe Identifier do
describe ".create" do
let(:attrs) { {shoulder: TEST_ARK_SHOULDER, profile: "dc", target: "http://example.com"} }
- it "should instantiate a new Identifier and save it" do
+ it "should instantiate a new Identifier and save it" do
expect(described_class).to receive(:new).with(attrs).and_call_original
expect_any_instance_of(described_class).to receive(:save) { double }
described_class.create(attrs)
end
describe "when given neither an id nor a shoulder" do
@@ -65,11 +65,11 @@
expect(subject.status).to eq("public")
end
end
end
end
-
+
describe "#update" do
let(:metadata) { {"status" => "unavailable"} }
subject { described_class.new(id: "id") }
it "should update the metadata and save" do
expect(subject).to receive(:update_metadata).with(metadata)
@@ -167,22 +167,22 @@
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.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.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_public }
it { is_expected.not_to be_reserved }
it { is_expected.to be_unavailable }
end
end