Skip to content
Extraits de code Groupes Projets
Valider 3d7d8b51 rédigé par Raphael's avatar Raphael
Parcourir les fichiers

Add a spec to user, fix a cucumber step for mysql

parent 5a1bd138
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -27,7 +27,7 @@ class User < ActiveRecord::Base
validates_associated :person
has_one :person, :foreign_key => :owner_id
delegate :public_key, :posts, :owns?, :diaspora_handle, :name, :public_url, :profile, :to => :person
delegate :public_key, :posts, :owns?, :diaspora_handle, :name, :public_url, :profile, :first_name, :last_name, :to => :person
has_many :invitations_from_me, :class_name => 'Invitation', :foreign_key => :sender_id
has_many :invitations_to_me, :class_name => 'Invitation', :foreign_key => :recipient_id
......
......@@ -37,7 +37,7 @@ When /^I wait for the aspects page to load$/ do
end
When /^I wait for the request's profile page to load$/ do
wait_until { current_path == person_path(Request.to(@me).first.from) }
wait_until { current_path == person_path(Request.where(:recipient_id => @me.id).first.sender) }
end
When /^I wait for the ajax to finish$/ do
......
......@@ -262,6 +262,16 @@ describe User do
user.update_profile(params).should be_true
user.reload.profile.image_url.should == "http://clown.com"
end
it 'only pushes to a given person once' do
connect_users(user, aspect, user2, aspect2)
user.add_contact_to_aspect(user.contact_for(user2.person),
user.aspects.create(:name => "Newsies"))
user.should_receive(:push_to_person).once
user.update_profile(@params).should be_true
end
it "only pushes to non-pending contacts" do
connect_users(user, aspect, user2, aspect2)
user.contacts.count.should == 1
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter