Skip to content
Snippets Groups Projects
Commit dccd8b6e authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Continue refactoring. Use repostory and team

parent 39ba934c
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -6,7 +6,7 @@ describe "Projects" do
describe "GET /projects/show" do
before do
@project = create(:project, namespace: @user.namespace)
@project.add_access(@user, :read)
@project.team << [@user, :reporter]
 
visit project_path(@project)
end
Loading
Loading
@@ -19,7 +19,7 @@ describe "Projects" do
describe "GET /projects/:id/edit" do
before do
@project = create(:project)
@project.add_access(@user, :admin, :read)
@project.team << [@user, :master]
 
visit edit_project_path(@project)
end
Loading
Loading
@@ -38,7 +38,7 @@ describe "Projects" do
describe "PUT /projects/:id" do
before do
@project = create(:project, namespace: @user.namespace)
@project.add_access(@user, :admin, :read)
@project.team << [@user, :master]
 
visit edit_project_path(@project)
 
Loading
Loading
@@ -59,7 +59,7 @@ describe "Projects" do
describe "DELETE /projects/:id" do
before do
@project = create(:project, namespace: @user.namespace)
@project.add_access(@user, :read, :admin)
@project.team << [@user, :master]
visit edit_project_path(@project)
end
 
Loading
Loading
# Stubs out all Git repository access done by models so that specs can run
# against fake repositories without Grit complaining that they don't exist.
class Project
def path_to_repo
if new_record? || path == 'newproject'
# There are a couple Project specs and features that expect the Project's
# path to be in the returned path, so let's patronize them.
Rails.root.join('tmp', 'repositories', path)
else
# For everything else, just give it the path to one of our real seeded
# repos.
Rails.root.join('tmp', 'repositories', 'gitlabhq')
end
end
def satellite
FakeSatellite.new
end
Loading
Loading
@@ -27,3 +15,9 @@ class Project
end
end
end
class Repository
def repo
@repo ||= Grit::Repo.new(Rails.root.join('tmp', 'repositories', 'gitlabhq'))
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment