From 25c57637807bac79037c4d791979951bf13ed056 Mon Sep 17 00:00:00 2001 From: Andrey Kumanyaev Date: Wed, 26 Dec 2012 02:52:49 +0400 Subject: Add functional in user section --- features/group/group.feature | 7 +++++++ features/steps/group/group.rb | 19 +++++++++++++++++++ features/steps/shared/paths.rb | 4 ++++ 3 files changed, 30 insertions(+) (limited to 'features') diff --git a/features/group/group.feature b/features/group/group.feature index 07308112270..4b8483bd361 100644 --- a/features/group/group.feature +++ b/features/group/group.feature @@ -17,3 +17,10 @@ Feature: Groups Given project from group has merge requests assigned to me When I visit group merge requests page Then I should see merge requests from this group assigned to me + + Scenario: I should add user to projects in Group + Given I have new user "John" + When I visit group page + When I visit group people page + When I select user "John" from list with role "Reporter" + Then I should see user "John" in team list diff --git a/features/steps/group/group.rb b/features/steps/group/group.rb index 4de260ec33e..03693852072 100644 --- a/features/steps/group/group.rb +++ b/features/steps/group/group.rb @@ -32,6 +32,25 @@ class Groups < Spinach::FeatureSteps end end + Given 'I have new user "John"' do + create(:user, name: "John") + end + + When 'I select user "John" from list with role "Reporter"' do + user = User.find_by_name("John") + within "#new_team_member" do + select user.name, :from => "user_ids" + select "Reporter", :from => "project_access" + end + click_button "Add" + end + + Then 'I should see user "John" in team list' do + user = User.find_by_name("John") + projects_with_access = find(".ui-box .well-list li") + projects_with_access.should have_content("John") + end + Given 'project from group has issues assigned to me' do create :issue, project: project, diff --git a/features/steps/shared/paths.rb b/features/steps/shared/paths.rb index a12576288df..bd43ba6b3dc 100644 --- a/features/steps/shared/paths.rb +++ b/features/steps/shared/paths.rb @@ -21,6 +21,10 @@ module SharedPaths visit merge_requests_group_path(current_group) end + When 'I visit group people page' do + visit people_group_path(current_group) + end + # ---------------------------------------- # Dashboard # ---------------------------------------- -- cgit v1.2.1