+
+ <% button_bar do %>
+ <%= submit_button(:ok, _('Ok!')) %>
+ <% end %>
+<% end %>
diff --git a/features/invitation.feature b/features/invitation.feature
index e1afedc..46b124d 100644
--- a/features/invitation.feature
+++ b/features/invitation.feature
@@ -4,9 +4,9 @@ Feature: invitation
Background:
Given the following users
- | login |
- | josesilva |
- | josesantos |
+ | login | email |
+ | josesilva | silva@invalid.br |
+ | josesantos | santos@invalid.br |
And the following communities
| owner | identifier | name |
| josesilva | 26-bsslines | 26 Bsslines |
@@ -72,14 +72,89 @@ Feature: invitation
Then I should see "Access denied"
Scenario: not see link to invite members to enterprise in manage members
- Given I am on /myprofile/beatles-for-sale/profile_members
+ Given I am on Beatles For Sale's members management
Then I should not see "Invite your friends to join Beatles For Sale" link
Scenario: back to manage members after invite friends
- Given I am on /myprofile/26-bsslines/profile_members
+ Given I am on 26 Bsslines's members management
And I follow "Invite your friends to join 26 Bsslines"
And I press "Next"
And I fill in "manual_import_addresses" with "misfits@devil.doll"
And I fill in "mail_template" with "Follow this link "
When I press "Invite my friends!"
Then I should be on /myprofile/26-bsslines/profile_members
+
+ Scenario: noosfero user receives a task when a user invites to join a community
+ Given I am on 26 Bsslines's members management
+ And I follow "Invite your friends to join 26 Bsslines"
+ And I press "Next"
+ And I fill in "manual_import_addresses" with "santos@invalid.br"
+ And I fill in "mail_template" with "Follow this link "
+ And I press "Invite my friends!"
+ When I am logged in as "josesantos"
+ And I follow "Control Panel"
+ And I should see "josesilva invites you to join the community 26 Bsslines."
+
+ Scenario: noosfero user accepts to join community
+ Given I invite email "santos@invalid.br" to join community "26 Bsslines"
+ When I am logged in as "josesantos"
+ And I follow "Control panel"
+ And I follow "Process requests"
+ And I should see "josesilva invites you to join the community 26 Bsslines."
+ And I choose "Accept"
+ When I press "Ok!"
+ Then I should not see "josesilva invites you to join the community 26 Bsslines."
+ When I follow "Control panel"
+ And I follow "Manage my groups"
+ Then I should see "26 Bsslines"
+
+ Scenario: noosfero user rejects to join community
+ Given I invite email "santos@invalid.br" to join community "26 Bsslines"
+ When I am logged in as "josesantos"
+ And I follow "Control panel"
+ And I follow "Process requests"
+ And I should see "josesilva invites you to join the community 26 Bsslines."
+ And I choose "Reject"
+ When I press "Ok!"
+ Then I should not see "josesilva invites you to join the community 26 Bsslines."
+ When I follow "Control panel"
+ And I follow "Manage my groups"
+ Then I should not see "26 Bsslines"
+
+ Scenario: noosfero user receives a task when a user invites to be friend
+ Given I am on josesilva's control panel
+ And I follow "Manage Friends"
+ And I follow "Invite people from my e-mail contacts"
+ And I press "Next"
+ And I fill in "manual_import_addresses" with "santos@invalid.br"
+ And I fill in "mail_template" with "Follow this link "
+ And I press "Invite my friends!"
+ When I am logged in as "josesantos"
+ And I follow "Control Panel"
+ And I should see "josesilva wants to be your friend."
+
+ Scenario: noosfero user accepts to be friend
+ Given I invite email "santos@invalid.br" to be my friend
+ When I am logged in as "josesantos"
+ And I follow "Control panel"
+ And I follow "Process requests"
+ And I should see "josesilva wants to be your friend."
+ And I choose "Accept"
+ When I press "Ok!"
+ And I should not see "josesilva wants to be your friend."
+ When I follow "Control panel"
+ And I follow "Manage friends"
+ Then I should see "josesilva"
+
+ Scenario: noosfero user rejects to be friend
+ Given I invite email "santos@invalid.br" to be my friend
+ When I am logged in as "josesantos"
+ And I follow "Control panel"
+ And I follow "Process requests"
+ And I should see "josesilva wants to be your friend."
+ And I choose "Ignore"
+ When I press "Ok!"
+ And I should not see "josesilva wants to be your friend."
+ When I follow "Control panel"
+ And I follow "Manage friends"
+ Then I should not see "josesilva"
diff --git a/features/step_definitions/invitation_steps.rb b/features/step_definitions/invitation_steps.rb
new file mode 100644
index 0000000..7dabb97
--- /dev/null
+++ b/features/step_definitions/invitation_steps.rb
@@ -0,0 +1,19 @@
+Given /^I invite email "(.+)" to join community "(.+)"$/ do |email, community|
+ identifier = Community.find_by_name(community).identifier
+ visit("/myprofile/#{identifier}/profile_members")
+ click_link('Invite your friends to join 26 Bsslines')
+ click_button('Next')
+ fill_in('manual_import_addresses', :with => "#{email}")
+ fill_in('mail_template', :with => 'Follow this link ')
+ click_button("Invite my friends!")
+end
+
+Given /^I invite email "(.+)" to be my friend$/ do |email|
+ click_link('Control panel')
+ click_link('Manage friends')
+ click_link('Invite people from my e-mail contacts')
+ click_button('Next')
+ fill_in('manual_import_addresses', :with => "#{email}")
+ fill_in('mail_template', :with => 'Follow this link ')
+ click_button("Invite my friends!")
+end
diff --git a/features/support/paths.rb b/features/support/paths.rb
index 3417932..074ef57 100644
--- a/features/support/paths.rb
+++ b/features/support/paths.rb
@@ -45,6 +45,9 @@ module NavigationHelpers
when /^(.+)'s cms/
'/myprofile/%s/cms' % Profile.find_by_name($1).identifier
+ when /^(.+)'s members management/
+ '/myprofile/%s/profile_members' % Profile.find_by_name($1).identifier
+
# Add more mappings here.
# Here is a more fancy example:
#
--
libgit2 0.21.2