fix spec_helper for 1.9.2
This commit is contained in:
parent
40120bb441
commit
19199dabfe
4 changed files with 33 additions and 6 deletions
|
|
@ -103,7 +103,7 @@ describe Diaspora::Parser do
|
|||
|
||||
it "should activate the Person if I initiated a request to that url" do
|
||||
request = @user.send_friend_request_to( @user2.person, @aspect)
|
||||
|
||||
@user.reload
|
||||
request.reverse_for @user2
|
||||
|
||||
xml = request.to_diaspora_xml
|
||||
|
|
@ -125,6 +125,7 @@ describe Diaspora::Parser do
|
|||
it 'should process retraction for a person' do
|
||||
person_count = Person.all.count
|
||||
request = @user.send_friend_request_to( @user2.person, @aspect)
|
||||
@user.reload
|
||||
request.reverse_for @user2
|
||||
xml = request.to_diaspora_xml
|
||||
|
||||
|
|
|
|||
|
|
@ -34,4 +34,25 @@ describe 'making sure the spec runner works' do
|
|||
end
|
||||
|
||||
end
|
||||
describe '#friend_users' do
|
||||
before do
|
||||
@user1 = Factory.create(:user)
|
||||
@aspect1 = @user1.aspect(:name => "losers")
|
||||
@user2 = Factory.create(:user)
|
||||
@aspect2 = @user2.aspect(:name => "bruisers")
|
||||
friend_users(@user1, @aspect1, @user2, @aspect2)
|
||||
@user1.reload
|
||||
@aspect1.reload
|
||||
@user2.reload
|
||||
@aspect2.reload
|
||||
end
|
||||
|
||||
it 'makes the first user friends with the second' do
|
||||
@aspect1.people.include?(@user2.person).should be_true
|
||||
end
|
||||
|
||||
it 'makes the second user friends with the first' do
|
||||
@aspect2.people.include?(@user1.person).should be_true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ describe Aspect do
|
|||
aspect.name.should == "losers"
|
||||
end
|
||||
|
||||
it 'should be able to have people' do
|
||||
it 'should be creatable with people' do
|
||||
aspect = @user.aspect(:name => 'losers', :people => [@friend, @friend_2])
|
||||
aspect.people.size.should == 2
|
||||
end
|
||||
|
|
@ -156,16 +156,16 @@ describe Aspect do
|
|||
@user.receive message.to_diaspora_xml
|
||||
@aspect.reload
|
||||
|
||||
@aspect.posts.count.should be 1
|
||||
@aspect3.posts.count.should be 0
|
||||
@aspect.posts.count.should == 1
|
||||
@aspect3.posts.count.should == 0
|
||||
|
||||
@user.reload
|
||||
@user.move_friend(:friend_id => @user2.person.id, :from => @aspect.id, :to => @aspect3.id)
|
||||
@aspect.reload
|
||||
@aspect3.reload
|
||||
|
||||
@aspect3.posts.count.should be 1
|
||||
@aspect.posts.count.should be 0
|
||||
@aspect3.posts.count.should == 1
|
||||
@aspect.posts.count.should == 0
|
||||
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -82,7 +82,12 @@ end
|
|||
def friend_users(user1, aspect1, user2, aspect2)
|
||||
request = user1.send_friend_request_to(user2.person, aspect1)
|
||||
reversed_request = user2.accept_friend_request( request.id, aspect2.id)
|
||||
user1.reload
|
||||
user1.receive reversed_request.to_diaspora_xml
|
||||
user1.reload
|
||||
aspect1.reload
|
||||
user2.reload
|
||||
aspect2.reload
|
||||
end
|
||||
|
||||
def stub_success(address = 'abc@example.com')
|
||||
|
|
|
|||
Loading…
Reference in a new issue