Continue refactoring. Use repostory and team

This commit is contained in:
Dmitriy Zaporozhets 2013-01-04 08:43:25 +02:00
parent 39ba934c0a
commit dccd8b6eaa
42 changed files with 219 additions and 179 deletions

View file

@ -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

View file

@ -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