replace =~ array matching with match_array

This commit is contained in:
Jonne Haß 2014-01-06 19:18:56 +01:00
parent 525cd4cc02
commit 7bb055932a
3 changed files with 8 additions and 8 deletions

View file

@ -132,7 +132,7 @@ describe Reshare do
it 'allows you to destroy the reshare if the root post is missing' do
reshare = FactoryGirl.build(:reshare)
reshare.root = nil
expect{
reshare.destroy
}.to_not raise_error
@ -159,7 +159,7 @@ describe Reshare do
wf_prof_mock = mock
wf_prof_mock.should_receive(:fetch).and_return(@original_author)
Webfinger.should_receive(:new).and_return(wf_prof_mock)
@response.stub(:body).and_return(@root_object.to_diaspora_xml)
Faraday.default_connection.should_receive(:get).with(@original_author.url + short_post_path(@root_object.guid, :format => "xml")).and_return(@response)
@ -170,17 +170,17 @@ describe Reshare do
it "doesn't error out if the post is not found" do
@response.stub(:status).and_return(404)
Faraday.default_connection.should_receive(:get).and_return(@response)
expect {
Reshare.from_xml(@xml)
}.to_not raise_error
end
it "raises if there's another error receiving the post" do
@response.stub(:status).and_return(500)
@response.stub(:success?).and_return(false)
Faraday.default_connection.should_receive(:get).and_return(@response)
expect {
Reshare.from_xml(@xml)
}.to raise_error RuntimeError

View file

@ -263,8 +263,8 @@ STR
msg_lc.save; msg_uc.save; msg_cp.save
tag_array = msg_lc.tags
msg_uc.tags.should =~ tag_array
msg_cp.tags.should =~ tag_array
expect(msg_uc.tags).to match_array(tag_array)
expect(msg_cp.tags).to match_array(tag_array)
end
end

View file

@ -66,7 +66,7 @@ describe User::Querying do
it "does not contain duplicate posts" do
bobs_other_aspect = bob.aspects.create(:name => "cat people")
bob.add_contact_to_aspect(bob.contact_for(alice.person), bobs_other_aspect)
bob.aspects_with_person(alice.person).should =~ [@bobs_aspect, bobs_other_aspect]
expect(bob.aspects_with_person(alice.person)).to match_array [@bobs_aspect, bobs_other_aspect]
bobs_post = bob.post(:status_message, :text => "hai to all my people", :to => [@bobs_aspect.id, bobs_other_aspect.id])