diff --git a/app/views/users/getting_started/_step_2.html.haml b/app/views/users/getting_started/_step_2.html.haml index d094b063c..8f6bcf4a7 100644 --- a/app/views/users/getting_started/_step_2.html.haml +++ b/app/views/users/getting_started/_step_2.html.haml @@ -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 diff --git a/features/accepts_invitation.feature b/features/accepts_invitation.feature index 23ac5201d..ec39d54f0 100644 --- a/features/accepts_invitation.feature +++ b/features/accepts_invitation.feature @@ -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" diff --git a/features/step_definitions/user_steps.rb b/features/step_definitions/user_steps.rb index 570395e53..4ff3a9511 100644 --- a/features/step_definitions/user_steps.rb +++ b/features/step_definitions/user_steps.rb @@ -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