Add a cuke for being invited by someone

This commit is contained in:
Raphael 2010-12-05 00:15:37 -08:00
parent 36e1fb8b2c
commit c320dae589
3 changed files with 49 additions and 13 deletions

View file

@ -9,19 +9,20 @@
.description
= t('.description')
%h3
= t('.your_inviter')
-if @requests.size > 0
%h3
= t('.your_inviter')
%h3
%ul.dropzone
- if @requests.size < 1
%li=t('.no_requests')
- else
- for request in @requests
%li.person.request{:data=>{:guid=>request.id, :person_id=>request.from.id}}
= person_image_link(request.from)
.requests
%p= "#{t('.drag_to_add')} =>"
%h3
%ul.dropzone
- if @requests.size < 1
%li=t('.no_requests')
- else
- for request in @requests
%li.person.request{:data=>{:guid=>request.id, :person_id=>request.from.id}}
= person_image_link(request.from)
.requests
%p= "#{t('.drag_to_add')} =>"
%ul#aspect_list

View file

@ -1,6 +1,6 @@
@javascript
Feature: invitation acceptance
Scenario: accept invitation
Scenario: accept invitation from admin
Given I have been invited by an admin
And I am on my acceptance form page
And I fill in "Username" with "ohai"
@ -10,4 +10,33 @@ Feature: invitation acceptance
Then I should be on the getting started page
And I should see "Welcome to Diaspora!"
And I should see "ohai"
And I fill in "person_profile_first_name" with "O"
And I fill in "person_profile_last_name" with "Hai"
And I fill in "person_profile_gender" with "guess!"
And I press "Save and continue"
Then I should see "Profile updated"
And I should see "Your aspects"
And I should not see "Here are the people who are waiting for you:"
Scenario: accept invitation from user
Given I have been invited by a user
And I am on my acceptance form page
And I fill in "Username" with "ohai"
And I fill in "user_password" with "secret"
And I fill in "Password confirmation" with "secret"
And I press "Sign up"
Then I should be on the getting started page
And I should see "Welcome to Diaspora!"
And I should see "ohai"
And I fill in "person_profile_first_name" with "O"
And I fill in "person_profile_last_name" with "Hai"
And I fill in "person_profile_gender" with "guess!"
And I press "Save and continue"
Then I should see "Profile updated"
And I should see "Your aspects"
And I should see "Here are the people who are waiting for you:"
And I should see 1 contact request
When I drag the contact request to the "Family" aspect
And I wait for the ajax to finish
Then I should see 1 contact in "Family"

View file

@ -7,6 +7,12 @@ Given /^I have been invited by an admin$/ do
@me = Invitation.create_invitee(:email => "new_invitee@example.com")
end
Given /^I have been invited by a user$/ do
@inviter = Factory(:user)
aspect = @inviter.aspects.create(:name => "Rocket Scientists")
@me = @inviter.invite_user("new_invitee@example.com", aspect.id, "Hey, tell me about your rockets!")
end
When /^I click on my name$/ do
click_link("#{@me.first_name} #{@me.last_name}")
end