Commit ef5b36eaaf92db19ae90cc599c3f64b865bdc4d5
1 parent
afbdbb0c
Exists in
master
and in
4 other branches
Fixed protected branches and file edit
Showing
9 changed files
with
21 additions
and
20 deletions
Show diff stats
app/controllers/admin/users_controller.rb
| ... | ... | @@ -19,9 +19,9 @@ class Admin::UsersController < AdminController |
| 19 | 19 | def team_update |
| 20 | 20 | @admin_user = User.find(params[:id]) |
| 21 | 21 | |
| 22 | - UsersProject.user_bulk_import( | |
| 23 | - @admin_user, | |
| 22 | + UsersProject.add_users_into_projects( | |
| 24 | 23 | params[:project_ids], |
| 24 | + [@admin_user.id], | |
| 25 | 25 | params[:project_access] |
| 26 | 26 | ) |
| 27 | 27 | ... | ... |
app/controllers/tree_controller.rb
app/models/users_project.rb
| ... | ... | @@ -128,16 +128,6 @@ class UsersProject < ActiveRecord::Base |
| 128 | 128 | end |
| 129 | 129 | end |
| 130 | 130 | |
| 131 | - # TODO: depreceate in future in favor of add_users_into_projects | |
| 132 | - def bulk_import(project, user_ids, project_access) | |
| 133 | - add_users_into_projects([project.id], user_ids, project_access) | |
| 134 | - end | |
| 135 | - | |
| 136 | - # TODO: depreceate in future in favor of add_users_into_projects | |
| 137 | - def user_bulk_import(user, project_ids, project_access) | |
| 138 | - add_users_into_projects(project_ids, [user.id], project_access) | |
| 139 | - end | |
| 140 | - | |
| 141 | 131 | def roles_hash |
| 142 | 132 | { |
| 143 | 133 | guest: GUEST, | ... | ... |
app/views/protected_branches/index.html.haml
app/views/repositories/_feed.html.haml
features/steps/project/create_project.rb
| ... | ... | @@ -3,13 +3,13 @@ class CreateProject < Spinach::FeatureSteps |
| 3 | 3 | include SharedPaths |
| 4 | 4 | |
| 5 | 5 | And 'fill project form with valid data' do |
| 6 | - fill_in 'project_name', :with => 'NewProject' | |
| 6 | + fill_in 'project_name', with: 'Empty' | |
| 7 | 7 | click_button "Create project" |
| 8 | 8 | end |
| 9 | 9 | |
| 10 | 10 | Then 'I should see project page' do |
| 11 | 11 | current_path.should == project_path(Project.last) |
| 12 | - page.should have_content "NewProject" | |
| 12 | + page.should have_content "Empty" | |
| 13 | 13 | end |
| 14 | 14 | |
| 15 | 15 | And 'I should see empty project instuctions' do | ... | ... |
features/steps/project/project_browse_commits.rb
| ... | ... | @@ -48,7 +48,7 @@ class ProjectBrowseCommits < Spinach::FeatureSteps |
| 48 | 48 | page.should have_selector('ul.breadcrumb span.divider', count: 3) |
| 49 | 49 | page.should have_selector('ul.breadcrumb a', count: 4) |
| 50 | 50 | |
| 51 | - find('ul.breadcrumb li:first a')['href'].should match(/#{@project.path}\/commits\/master\z/) | |
| 51 | + find('ul.breadcrumb li:first a')['href'].should match(/#{@project.path_with_namespace}\/commits\/master\z/) | |
| 52 | 52 | find('ul.breadcrumb li:last a')['href'].should match(%r{master/app/models/project\.rb\z}) |
| 53 | 53 | end |
| 54 | 54 | ... | ... |
spec/models/commit_spec.rb
spec/support/stubbed_repository.rb
| 1 | +require "repository" | |
| 2 | +require "project" | |
| 3 | + | |
| 1 | 4 | # Stubs out all Git repository access done by models so that specs can run |
| 2 | 5 | # against fake repositories without Grit complaining that they don't exist. |
| 3 | 6 | class Project |
| 7 | + def repository | |
| 8 | + if path == "empty" || !path | |
| 9 | + nil | |
| 10 | + else | |
| 11 | + GitLabTestRepo.new(path_with_namespace) | |
| 12 | + end | |
| 13 | + end | |
| 14 | + | |
| 4 | 15 | def satellite |
| 5 | 16 | FakeSatellite.new |
| 6 | 17 | end |
| ... | ... | @@ -16,7 +27,7 @@ class Project |
| 16 | 27 | end |
| 17 | 28 | end |
| 18 | 29 | |
| 19 | -class Repository | |
| 30 | +class GitLabTestRepo < Repository | |
| 20 | 31 | def repo |
| 21 | 32 | @repo ||= Grit::Repo.new(Rails.root.join('tmp', 'repositories', 'gitlabhq')) |
| 22 | 33 | end | ... | ... |