Merge branch 'master' of github.com:diaspora/diaspora
This commit is contained in:
commit
eafc01de2a
4 changed files with 64 additions and 58 deletions
|
|
@ -122,7 +122,6 @@ GEM
|
|||
selenium-webdriver (>= 0.0.3)
|
||||
childprocess (0.0.7)
|
||||
ffi (~> 0.6.3)
|
||||
columnize (0.3.1)
|
||||
crack (0.1.8)
|
||||
cucumber (0.9.2)
|
||||
builder (~> 2.1.2)
|
||||
|
|
@ -163,7 +162,6 @@ GEM
|
|||
i18n (0.4.1)
|
||||
json (1.4.6)
|
||||
json_pure (1.4.6)
|
||||
linecache (0.43)
|
||||
mail (2.2.7)
|
||||
activesupport (>= 2.3.6)
|
||||
mime-types
|
||||
|
|
@ -225,11 +223,6 @@ GEM
|
|||
rspec-expectations (= 2.0.0)
|
||||
rspec-rails (2.0.0)
|
||||
rspec (= 2.0.0)
|
||||
ruby-debug (0.10.3)
|
||||
columnize (>= 0.1)
|
||||
ruby-debug-base (~> 0.10.3.0)
|
||||
ruby-debug-base (0.10.3)
|
||||
linecache (>= 0.3)
|
||||
rubyzip (0.9.4)
|
||||
selenium-webdriver (0.0.29)
|
||||
childprocess (>= 0.0.7)
|
||||
|
|
@ -287,7 +280,6 @@ DEPENDENCIES
|
|||
roxml!
|
||||
rspec (>= 2.0.0)
|
||||
rspec-rails (>= 2.0.0)
|
||||
ruby-debug
|
||||
sprinkle!
|
||||
thin
|
||||
webmock
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ module AspectsHelper
|
|||
|
||||
def remove_link( aspect )
|
||||
if aspect.people.size == 0
|
||||
link_to I18n.t('aspects.helper.remove'), aspect, :method => :delete
|
||||
link_to I18n.t('aspects.helper.remove'), aspect, :method => :delete, :confirm => "Are you sure you want to delete this aspect?"
|
||||
else
|
||||
"<span class='grey' title=#{I18n.t('aspects.helper.aspect_not_empty')}>#{I18n.t('aspects.helper.remove')}</span>"
|
||||
end
|
||||
|
|
|
|||
91
spec/fixtures/hcard_response
vendored
91
spec/fixtures/hcard_response
vendored
|
|
@ -1,44 +1,49 @@
|
|||
<div id="content">
|
||||
<h1>Alexander Hamiltom</h1>
|
||||
<div id="content_inner">
|
||||
<div id="i" class="entity_profile vcard author">
|
||||
<h2>User profile</h2>
|
||||
<dl class="entity_nickname">
|
||||
<dt>Nickname</dt>
|
||||
<dd>
|
||||
<a href="http://tom.joindiaspora.com/" rel="me" class="nickname url uid">Alexander Hamiltom</a>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="entity_given_name">
|
||||
<dt>Full name</dt>
|
||||
<dd>
|
||||
<span class="given_name" >Alexander</span>
|
||||
</dd>
|
||||
</dl>
|
||||
<div id="content">
|
||||
<h1>Alexander Hamiltom</h1>
|
||||
<div id="content_inner">
|
||||
<div id="i" class="entity_profile vcard author">
|
||||
<h2>User profile</h2>
|
||||
<dl class="entity_nickname">
|
||||
<dt>Nickname</dt>
|
||||
<dd>
|
||||
<a href="http://tom.joindiaspora.com/" rel="me" class="nickname url uid">Alexander Hamiltom</a>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="entity_given_name">
|
||||
<dt>First name</dt>
|
||||
<dd>
|
||||
<span class="given_name" >Alexander</span>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="entity_family_name">
|
||||
<dt>Family name</dt>
|
||||
<dd>
|
||||
<span class="family_name" >Hamiltom</span>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="entity_fn">
|
||||
<dt>Full name</dt>
|
||||
<dd>
|
||||
<span class="fn" >Alexander Hamiltom</span>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="entity_url">
|
||||
<dt>URL</dt>
|
||||
<dd>
|
||||
<a href="http://tom.joindiaspora.com/" rel="me" id="pod_location" class="url">http://tom.joindiaspora.com/</a>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="entity_photo">
|
||||
<dt>Photo</dt>
|
||||
<dd>
|
||||
<img class="photo avatar" src="http://tom.joindiaspora.com/images/user/tom.jpg" width="100" height="100"/>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="entity_note">
|
||||
<dt>Note</dt>
|
||||
<dd class="note">Diaspora is awesome! vi is better than emacs!</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<dl class="entity_family_name">
|
||||
<dt>Full name</dt>
|
||||
<dd>
|
||||
<span class="family_name" >Hamiltom</span>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="entity_fn">
|
||||
<dt>Full name</dt>
|
||||
<dd>
|
||||
<span class="fn" >Alexander Hamiltom</span>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="entity_url">
|
||||
<dt>URL</dt>
|
||||
<dd>
|
||||
<a href="http://tom.joindiaspora.com/" rel="me" id="pod_location" class="url">http://tom.joindiaspora.com/</a>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="entity_note">
|
||||
<dt>Note</dt>
|
||||
<dd class="note">Diaspora is awesome! vi is better than emacs!</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ describe User do
|
|||
let(:wrong_aspect) {another_user.aspect(:name => "super")}
|
||||
let(:inviter_with_3_invites) {Factory.create :user, :invites => 3}
|
||||
let(:aspect2) {inviter_with_3_invites.aspect(:name => "Jersey Girls")}
|
||||
let!(:invited_user1) { create_user_with_invitation("abc", :email => "email@example.com", :inviter => inviter)}
|
||||
let!(:invited_user2) { inviter.invite_user(:email => "jane@example.com", :aspect_id => aspect.id) }
|
||||
#let!(:invited_user1) { create_user_with_invitation("abc", :email => "email@example.com", :inviter => inviter)}
|
||||
#let!(:invited_user2) { inviter.invite_user(:email => "jane@example.com", :aspect_id => aspect.id) }
|
||||
|
||||
before do
|
||||
deliverable = Object.new
|
||||
|
|
@ -20,17 +20,19 @@ describe User do
|
|||
::Devise.mailer.stub!(:invitation).and_return(deliverable)
|
||||
end
|
||||
|
||||
context "creating invites" do
|
||||
|
||||
context "creating invites" do
|
||||
it 'requires an apect' do
|
||||
pending
|
||||
proc{inviter.invite_user(:email => "maggie@example.com")}.should raise_error /Must invite into aspect/
|
||||
end
|
||||
|
||||
it 'requires your aspect' do
|
||||
pending
|
||||
proc{inviter.invite_user(:email => "maggie@example.com", :aspect_id => wrong_aspect.id)}.should raise_error /Must invite to your aspect/
|
||||
end
|
||||
|
||||
it 'creates a user' do
|
||||
pending
|
||||
inviter
|
||||
lambda {
|
||||
inviter.invite_user(:email => "joe@example.com", :aspect_id => aspect.id )
|
||||
|
|
@ -38,11 +40,13 @@ describe User do
|
|||
end
|
||||
|
||||
it 'sends email to the invited user' do
|
||||
pending
|
||||
::Devise.mailer.should_receive(:invitation).once
|
||||
inviter.invite_user(:email => "ian@example.com", :aspect_id => aspect.id)
|
||||
end
|
||||
|
||||
it 'adds the inviter to the invited_user' do
|
||||
pending
|
||||
invited_user = inviter.invite_user(:email => "marcy@example.com", :aspect_id => aspect.id)
|
||||
invited_user.reload
|
||||
invited_user.inviters.include?(inviter).should be_true
|
||||
|
|
@ -50,12 +54,14 @@ describe User do
|
|||
|
||||
|
||||
it 'adds a pending request to the invited user' do
|
||||
pending
|
||||
invited_user = inviter.invite_user(:email => "marcy@example.com", :aspect_id => aspect.id)
|
||||
invited_user.reload
|
||||
invited_user.pending_requests.find_by_callback_url(inviter.receive_url).nil?.should == false
|
||||
end
|
||||
|
||||
it 'adds a pending request to the inviter' do
|
||||
pending
|
||||
inviter.invite_user(:email => "marcy@example.com", :aspect_id => aspect.id)
|
||||
inviter.reload
|
||||
inviter.pending_requests.find_by_callback_url(inviter.receive_url).nil?.should == false
|
||||
|
|
@ -64,6 +70,7 @@ describe User do
|
|||
|
||||
context "limit on invites" do
|
||||
it 'does not invite users after 3 invites' do
|
||||
pending
|
||||
inviter_with_3_invites.invite_user(:email => "email1@example.com", :aspect_id => aspect2.id)
|
||||
inviter_with_3_invites.invite_user(:email => "email2@example.com", :aspect_id => aspect2.id)
|
||||
inviter_with_3_invites.invite_user(:email => "email3@example.com", :aspect_id => aspect2.id)
|
||||
|
|
@ -71,13 +78,16 @@ describe User do
|
|||
end
|
||||
|
||||
it 'does not invite people I already invited' do
|
||||
pending
|
||||
inviter_with_3_invites.invite_user(:email => "email1@example.com", :aspect_id => aspect2.id)
|
||||
proc{inviter_with_3_invites.invite_user(:email => "email1@example.com", :aspect_id => aspect2.id)}.should raise_error /You already invited this person/
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
context "the acceptance of an invitation" do
|
||||
it "should create the person with the passed in params" do
|
||||
pending
|
||||
person_count = Person.count
|
||||
u = invited_user1.accept_invitation!(:invitation_token => "abc",
|
||||
:username => "user",
|
||||
|
|
@ -90,6 +100,7 @@ describe User do
|
|||
end
|
||||
|
||||
it 'should auto accept the request for the sender into the right aspect' do
|
||||
pending
|
||||
u = invited_user2.accept_invitation!(:invitation_token => invited_user2.invitation_token,
|
||||
:username => "user",
|
||||
:password => "secret",
|
||||
|
|
@ -106,8 +117,6 @@ describe User do
|
|||
inviter.friends.include?(u.person).should be true
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
def create_user_with_invitation(invitation_token, attributes={})
|
||||
|
|
|
|||
Loading…
Reference in a new issue