diff --git a/features/create_community.feature b/features/create_community.feature index a07dffb..573b511 100644 --- a/features/create_community.feature +++ b/features/create_community.feature @@ -11,7 +11,7 @@ Feature: create community Scenario: a user creates a community Given I am logged in as "joaosilva" And feature "admin_must_approve_new_communities" is disabled on environment - And I go to the Control panel + And I go to joaosilva's control panel And I follow "Manage my groups" When I follow "Create a new community" And I fill in "Name" with "Fancy community" @@ -22,7 +22,7 @@ Feature: create community Scenario: a user creates a community when environment moderates it Given I am logged in as "joaosilva" And feature "admin_must_approve_new_communities" is enabled on environment - When I go to the Control panel + And I go to joaosilva's control panel And I follow "Manage my groups" And I follow "Create a new community" And I fill in "Name" with "Community for moderation" @@ -32,7 +32,7 @@ Feature: create community Scenario: a user tries to create a community without a name Given I am logged in as "joaosilva" And feature "admin_must_approve_new_communities" is disabled on environment - And I go to the Control panel + And I go to joaosilva's control panel And I follow "Manage my groups" When I follow "Create a new community" And I press "Create" @@ -42,20 +42,20 @@ Feature: create community Given I am logged in as admin And feature "admin_must_approve_new_communities" is enabled on environment When I create community "Community for approval" - And I go to the Control panel + And I go to admin_user's control panel Then I should see "admin_user wants to create community Community for approval" Scenario: environment admin accepts new community task Given I am logged in as admin And feature "admin_must_approve_new_communities" is enabled on environment When I create community "Community for approval" - And I go to the Control panel + And I go to admin_user's control panel And I follow "Process requests" And I should see "admin_user wants to create community Community for approval" And I choose "Accept" When I press "Apply!" Then I should not see "admin_user wants to create community Community for approval" - When I go to the Control panel + And I go to admin_user's control panel And I follow "Manage my groups" Then I should see "Community for approval" @@ -63,13 +63,13 @@ Feature: create community Given I am logged in as admin And feature "admin_must_approve_new_communities" is enabled on environment When I create community "Community for approval" - And I go to the Control panel + And I go to admin_user's control panel And I follow "Process requests" And I should see "admin_user wants to create community Community for approval" And I choose "Reject" When I press "Apply!" Then I should not see "admin_user wants to create community Community for approval" - When I go to the Control panel + And I go to admin_user's control panel And I follow "Manage my groups" Then I should not see "Community for approval" @@ -78,7 +78,7 @@ Feature: create community And feature "admin_must_approve_new_communities" is enabled on environment When I create community "Community for approval" And I approve community "Community for approval" - When I go to the Control panel + And I go to admin_user's control panel And I follow "Manage my groups" Then I should see "Community for approval" @@ -87,6 +87,6 @@ Feature: create community And feature "admin_must_approve_new_communities" is enabled on environment When I create community "Community for approval" And I reject community "Community for approval" - When I go to the Control panel + And I go to admin_user's control panel And I follow "Manage my groups" Then I should not see "Community for approval" diff --git a/features/step_definitions/create_community_steps.rb b/features/step_definitions/create_community_steps.rb index e45dfa5..8ce49a4 100644 --- a/features/step_definitions/create_community_steps.rb +++ b/features/step_definitions/create_community_steps.rb @@ -1,7 +1,7 @@ include DatesHelper Given /^I create community "(.+)"$/ do |community| - Given 'I go to the Control panel' + Given %{I go to admin_user's control panel} click_link('Manage my groups') click_link('Create a new community') fill_in("Name", :with => community) @@ -10,7 +10,7 @@ end Given /^I approve community "(.+)"$/ do |community| task = CreateCommunity.all.select {|c| c.name == community}.first - Given 'I go to the Control panel' + Given %{I go to admin_user's control panel} click_link('Process requests') choose("decision-finish-#{task.id}") click_button('Apply!') @@ -18,7 +18,7 @@ end Given /^I reject community "(.+)"$/ do |community| task = CreateCommunity.all.select {|c| c.name == community}.first - Given 'I go to the Control panel' + Given %{I go to admin_user's control panel} click_link('Process requests') choose("decision-cancel-#{task.id}") click_button('Apply!') @@ -27,5 +27,5 @@ end Then /^I should see "([^\"]*)"'s creation date$/ do |community| com = Community.find_by_name community text = "Created at: #{show_date(com.created_at)}" - response.should contain(text) + has_content?(text) end diff --git a/features/support/paths.rb b/features/support/paths.rb index 1056d2c..a8c483f 100644 --- a/features/support/paths.rb +++ b/features/support/paths.rb @@ -72,9 +72,6 @@ module NavigationHelpers when /^(.*)'s control panel$/ '/myprofile/' + $1 - when /^the Control panel$/ - '/myprofile/%s' % User.find_by_id(session[:user]).login - when /the environment control panel/ '/admin' -- libgit2 0.21.2