diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-01-04 10:43:25 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-01-04 10:43:25 +0400 |
commit | dccd8b6eaa8b2e98b0245262a8e39df8fb8ae634 (patch) | |
tree | 541a40fb2e84b24ab0c4ae39fa18b1b720e5d7c2 /features | |
parent | 39ba934c0a65f571214998e056e925b61f389360 (diff) |
Continue refactoring. Use repostory and team
Diffstat (limited to 'features')
-rw-r--r-- | features/steps/admin/admin_groups.rb | 2 | ||||
-rw-r--r-- | features/steps/dashboard/dashboard.rb | 4 | ||||
-rw-r--r-- | features/steps/dashboard/dashboard_issues.rb | 2 | ||||
-rw-r--r-- | features/steps/dashboard/dashboard_merge_requests.rb | 4 | ||||
-rw-r--r-- | features/steps/dashboard/dashboard_search.rb | 6 | ||||
-rw-r--r-- | features/steps/group/group.rb | 2 | ||||
-rw-r--r-- | features/steps/project/project_team_management.rb | 6 | ||||
-rw-r--r-- | features/steps/shared/paths.rb | 14 | ||||
-rw-r--r-- | features/steps/shared/project.rb | 6 |
9 files changed, 23 insertions, 23 deletions
diff --git a/features/steps/admin/admin_groups.rb b/features/steps/admin/admin_groups.rb index 4cd071657fe..cbca2daa701 100644 --- a/features/steps/admin/admin_groups.rb +++ b/features/steps/admin/admin_groups.rb @@ -16,7 +16,7 @@ class AdminGroups < Spinach::FeatureSteps @project = create(:project, group: @group) @event = create(:closed_issue_event, project: @project) - @project.add_access current_user, :admin + @project.team << [current_user, :master] end And 'Create gitlab user "John"' do diff --git a/features/steps/dashboard/dashboard.rb b/features/steps/dashboard/dashboard.rb index 775a721f1a4..73e22673749 100644 --- a/features/steps/dashboard/dashboard.rb +++ b/features/steps/dashboard/dashboard.rb @@ -61,7 +61,7 @@ class Dashboard < Spinach::FeatureSteps And 'I own project "Shop"' do @project = create :project, name: 'Shop' - @project.add_access(@user, :admin) + @project.team << [@user, :master] end And 'I have group with projects' do @@ -69,7 +69,7 @@ class Dashboard < Spinach::FeatureSteps @project = create(:project, group: @group) @event = create(:closed_issue_event, project: @project) - @project.add_access current_user, :admin + @project.team << [current_user, :master] end And 'project "Shop" has push event' do diff --git a/features/steps/dashboard/dashboard_issues.rb b/features/steps/dashboard/dashboard_issues.rb index 5ace88023f0..fcf4296ad11 100644 --- a/features/steps/dashboard/dashboard_issues.rb +++ b/features/steps/dashboard/dashboard_issues.rb @@ -13,7 +13,7 @@ class DashboardIssues < Spinach::FeatureSteps And 'I have assigned issues' do project = create :project - project.add_access(@user, :read, :write) + project.team << [@user, :master] 2.times { create :issue, author: @user, assignee: @user, project: project } end diff --git a/features/steps/dashboard/dashboard_merge_requests.rb b/features/steps/dashboard/dashboard_merge_requests.rb index 485a4ccc113..7cfa8a13ff8 100644 --- a/features/steps/dashboard/dashboard_merge_requests.rb +++ b/features/steps/dashboard/dashboard_merge_requests.rb @@ -14,8 +14,8 @@ class DashboardMergeRequests < Spinach::FeatureSteps project1 = create :project project2 = create :project - project1.add_access(@user, :read, :write) - project2.add_access(@user, :read, :write) + project1.team << [@user, :master] + project2.team << [@user, :master] merge_request1 = create :merge_request, author: @user, project: project1 merge_request2 = create :merge_request, author: @user, project: project2 diff --git a/features/steps/dashboard/dashboard_search.rb b/features/steps/dashboard/dashboard_search.rb index a34c14d0c5f..9c8c879479d 100644 --- a/features/steps/dashboard/dashboard_search.rb +++ b/features/steps/dashboard/dashboard_search.rb @@ -1,6 +1,7 @@ class DashboardSearch < Spinach::FeatureSteps include SharedAuthentication include SharedPaths + include SharedProject Given 'I search for "Sho"' do fill_in "dashboard_search", with: "Sho" @@ -11,11 +12,6 @@ class DashboardSearch < Spinach::FeatureSteps page.should have_link "Shop" end - And 'I own project "Shop"' do - @project = create(:project, :name => "Shop") - @project.add_access(@user, :admin) - end - Given 'I search for "Contibuting"' do fill_in "dashboard_search", with: "Contibuting" click_button "Search" diff --git a/features/steps/group/group.rb b/features/steps/group/group.rb index e3364f09e34..04d8c874b3e 100644 --- a/features/steps/group/group.rb +++ b/features/steps/group/group.rb @@ -13,7 +13,7 @@ class Groups < Spinach::FeatureSteps @project = create(:project, group: @group) @event = create(:closed_issue_event, project: @project) - @project.add_access current_user, :admin + @project.team << [current_user, :master] end And 'I should see projects activity feed' do diff --git a/features/steps/project/project_team_management.rb b/features/steps/project/project_team_management.rb index 6bde0b64dfa..91b3ffeee9a 100644 --- a/features/steps/project/project_team_management.rb +++ b/features/steps/project/project_team_management.rb @@ -84,18 +84,18 @@ class ProjectTeamManagement < Spinach::FeatureSteps And '"Sam" is "Shop" developer' do user = User.find_by_name("Sam") project = Project.find_by_name("Shop") - project.add_access(user, :write) + project.team << [user, :developer] end Given 'I own project "Website"' do @project = create(:project, :name => "Website") - @project.add_access(@user, :admin) + @project.team << [@user, :master] end And '"Mike" is "Website" reporter' do user = User.find_by_name("Mike") project = Project.find_by_name("Website") - project.add_access(user, :read) + project.team << [user, :reporter] end And 'I click link "Import team from another project"' do diff --git a/features/steps/shared/paths.rb b/features/steps/shared/paths.rb index bd43ba6b3dc..22d1f335063 100644 --- a/features/steps/shared/paths.rb +++ b/features/steps/shared/paths.rb @@ -114,15 +114,15 @@ module SharedPaths end Given "I visit my project's files page" do - visit project_tree_path(@project, @project.root_ref) + visit project_tree_path(@project, root_ref) end Given "I visit my project's commits page" do - visit project_commits_path(@project, @project.root_ref, {limit: 5}) + visit project_commits_path(@project, root_ref, {limit: 5}) end Given "I visit my project's commits page for a specific path" do - visit project_commits_path(@project, @project.root_ref + "/app/models/project.rb", {limit: 5}) + visit project_commits_path(@project, root_ref + "/app/models/project.rb", {limit: 5}) end Given 'I visit my project\'s commits stats page' do @@ -174,7 +174,7 @@ module SharedPaths end Given 'I visit project commits page' do - visit project_commits_path(@project, @project.root_ref, {limit: 5}) + visit project_commits_path(@project, root_ref, {limit: 5}) end Given 'I visit project commits page for stable branch' do @@ -182,7 +182,7 @@ module SharedPaths end Given 'I visit project source page' do - visit project_tree_path(@project, @project.root_ref) + visit project_tree_path(@project, root_ref) end Given 'I visit blob file from repo' do @@ -240,4 +240,8 @@ module SharedPaths Given 'I visit project wiki page' do visit project_wiki_path(@project, :index) end + + def root_ref + @project.repository.root_ref + end end diff --git a/features/steps/shared/project.rb b/features/steps/shared/project.rb index dfc8ce9d99c..12dae15edf9 100644 --- a/features/steps/shared/project.rb +++ b/features/steps/shared/project.rb @@ -4,13 +4,13 @@ module SharedProject # Create a project without caring about what it's called And "I own a project" do @project = create(:project) - @project.add_access(@user, :admin) + @project.team << [@user, :master] end # Create a specific project called "Shop" And 'I own project "Shop"' do - @project = create(:project, :name => "Shop") - @project.add_access(@user, :admin) + @project = create(:project, name: "Shop") + @project.team << [@user, :master] end def current_project |