spec/ppl/service/postal_address_spec.rb in ppl-4.0.1 vs spec/ppl/service/postal_address_spec.rb in ppl-4.0.2

- old
+ new

@@ -19,30 +19,30 @@ }) @address = @contact.postal_addresses.first end it "adds one postal address to the contact" do - @contact.postal_addresses.length.should eq 1 + expect(@contact.postal_addresses.length).to eq 1 end it "sets the country of the new address" do - @address.country.should eq "United Kingdom" + expect(@address.country).to eq "United Kingdom" end it "sets the locality of the new address" do - @address.locality.should eq "Bristol" + expect(@address.locality).to eq "Bristol" end it "sets the street of the new address" do - @address.street.should eq "1 Broad Mead" + expect(@address.street).to eq "1 Broad Mead" end it "sets the PO box of the new address" do - @address.po_box.should eq "550011" + expect(@address.po_box).to eq "550011" end it "sets the postal code of the new address" do - @address.postal_code.should eq "BS1 1SB" + expect(@address.postal_code).to eq "BS1 1SB" end it "sets the region of the new address" do - @address.region.should eq "South West" + expect(@address.region).to eq "South West" end end describe "#update" do @@ -59,29 +59,29 @@ :region => "South West", }) end it "doesn't change the number of addresses owned by the contact" do - @contact.postal_addresses.length.should eq 1 + expect(@contact.postal_addresses.length).to eq 1 end it "sets the country of the new address" do - @address.country.should eq "United Kingdom" + expect(@address.country).to eq "United Kingdom" end it "sets the locality of the new address" do - @address.locality.should eq "Bristol" + expect(@address.locality).to eq "Bristol" end it "sets the street of the new address" do - @address.street.should eq "1 Broad Mead" + expect(@address.street).to eq "1 Broad Mead" end it "sets the PO box of the new address" do - @address.po_box.should eq "550011" + expect(@address.po_box).to eq "550011" end it "sets the postal code of the new address" do - @address.postal_code.should eq "BS1 1SB" + expect(@address.postal_code).to eq "BS1 1SB" end it "sets the region of the new address" do - @address.region.should eq "South West" + expect(@address.region).to eq "South West" end end describe "#update" do @@ -90,28 +90,28 @@ @address.id = "home" @contact.postal_addresses << @address end it "allows addresses to be moved" do - @service.should_receive(:move) + expect(@service).to receive(:move) @service.update(@contact, "home", {:new_id => "work"}) end it "sets addresses as preferred" do second_address = Ppl::Entity::PostalAddress.new second_address.id = "other" second_address.preferred = true @contact.postal_addresses << second_address @service.update(@contact, "home", {:preferred => true}) - @address.preferred.should eq true - second_address.preferred.should eq false + expect(@address.preferred).to eq true + expect(second_address.preferred).to eq false end it "sets addresses as not preferred" do @address.preferred = true @service.update(@contact, "home", {:preferred => false}) - @address.preferred.should eq false + expect(@address.preferred).to eq false end end describe "#move" do @@ -125,11 +125,11 @@ it "raises an error if the new ID is already in use" do expect{@service.move(@contact, "home", "other")}.to raise_error end it "moves the address to the new ID" do @service.move(@contact, "home", "available") - @address.id.should eq "available" + expect(@address.id).to eq "available" end end describe "#remove" do before(:each) do @@ -137,10 +137,10 @@ @contact.postal_addresses << @address @service.remove(@contact, "home") end it "removes the specified address" do - @contact.postal_addresses.length.should eq 0 + expect(@contact.postal_addresses.length).to eq 0 end it "raises an error if there is no such address" do expect{@service.remove(@contact, "home")}.to raise_error(Ppl::Error::PostalAddressNotFound) end