From 50918e28d630c1980e1eae3f6559fbff32bc04bf Mon Sep 17 00:00:00 2001 From: Daniel Cunha Date: Thu, 13 Dec 2012 01:26:11 -0300 Subject: [PATCH] invitation.feature --- features/invitation.feature | 36 +++++++++++++++++++----------------- features/step_definitions/invitation_steps.rb | 1 - features/step_definitions/noosfero_steps.rb | 8 -------- 3 files changed, 19 insertions(+), 26 deletions(-) diff --git a/features/invitation.feature b/features/invitation.feature index a8507fb..830c95c 100644 --- a/features/invitation.feature +++ b/features/invitation.feature @@ -46,8 +46,7 @@ Feature: invitation Then I should see "Invite your friends to join 26 Bsslines" link Scenario: not see link to invite members to community if has no rights - Given I am not logged in - And I am logged in as "josesantos" + Given I am logged in as "josesantos" When I am on /profile/26-bsslines/members Then I should not see "Invite your friends to join 26 Bsslines" link @@ -65,8 +64,7 @@ Feature: invitation Then I should not see "Invite your friends to join Beatles For Sale" link Scenario: deny access if user has no right to invite members - Given I am not logged in - And I am logged in as "josesantos" + Given I am logged in as "josesantos" When I am on /profile/26-bsslines/invite/friends Then I should see "Access denied" @@ -92,20 +90,20 @@ Feature: invitation And I press "Invite my friends!" Given there are no pending jobs When I am logged in as "josesantos" - And I go to the Control panel + And I go to josesantos's control panel And I should see "josesilva invited you to join 26 Bsslines." Scenario: noosfero user accepts to join community Given I invite email "santos@invalid.br" to join community "26 Bsslines" And there are no pending jobs When I am logged in as "josesantos" - And I go to the Control panel + And I go to josesantos's control panel And I follow "Process requests" And I should see "josesilva invited you to join 26 Bsslines." And I choose "Accept" When I press "Apply!" Then I should not see "josesilva invited you to join 26 Bsslines." - When I go to the Control panel + When I go to josesantos's control panel And I follow "Manage my groups" Then I should see "26 Bsslines" @@ -113,19 +111,19 @@ Feature: invitation Given I invite email "santos@invalid.br" to join community "26 Bsslines" And there are no pending jobs When I am logged in as "josesantos" - And I go to the Control panel + And I go to josesantos's control panel And I follow "Process requests" And I should see "josesilva invited you to join 26 Bsslines." And I choose "Reject" When I press "Apply!" Then I should not see "josesilva invited you to join 26 Bsslines." - When I go to the Control panel + And I go to josesantos's 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 "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" @@ -133,34 +131,38 @@ Feature: invitation And I press "Invite my friends!" Given there are no pending jobs When I am logged in as "josesantos" - And I go to the Control panel + And I go to josesantos's control panel And I follow "Process requests" Then 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 + Given I am logged in as "josesilva" + And I go to josesilva's control panel + And I invite email "santos@invalid.br" to be my friend And there are no pending jobs When I am logged in as "josesantos" - And I go to the Control panel + And I go to josesantos's control panel And I follow "Process requests" And I should see "josesilva wants to be your friend." And I choose "Accept" When I press "Apply!" And I should not see "josesilva wants to be your friend." - When I go to the Control panel + When I go to josesantos's 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 + Given I am logged in as "josesilva" + And I go to josesilva's control panel + And I invite email "santos@invalid.br" to be my friend And there are no pending jobs When I am logged in as "josesantos" - And I go to the Control panel + And I go to josesantos's control panel And I follow "Process requests" And I should see "josesilva wants to be your friend." And I choose "Reject" When I press "Apply!" And I should not see "josesilva wants to be your friend." - When I go to the Control panel + When I go to josesantos's 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 index 656ee86..a7aaf79 100644 --- a/features/step_definitions/invitation_steps.rb +++ b/features/step_definitions/invitation_steps.rb @@ -9,7 +9,6 @@ Given /^I invite email "(.+)" to join community "(.+)"$/ do |email, community| end Given /^I invite email "(.+)" to be my friend$/ do |email| - Given "I go to the Control panel" click_link('Manage friends') click_link('Invite people from my e-mail contacts') click_button('Next') diff --git a/features/step_definitions/noosfero_steps.rb b/features/step_definitions/noosfero_steps.rb index 86b4a19..2cd6875 100644 --- a/features/step_definitions/noosfero_steps.rb +++ b/features/step_definitions/noosfero_steps.rb @@ -443,14 +443,6 @@ Given /^the following environment configuration$/ do |table| env.save end -Then /^I should be logged in as "(.+)"$/ do |login| - User.find(session[:user]).login.should == login -end - -Then /^I should not be logged in$/ do - session[:user].nil? -end - Given /^the profile "(.+)" has no blocks$/ do |profile| profile = Profile[profile] profile.boxes.map do |box| -- libgit2 0.21.2