2014-09-22 10:30:25 -04:00
|
|
|
class Spinach::Features::AdminProjects < Spinach::FeatureSteps
|
2013-01-09 00:14:05 -05:00
|
|
|
include SharedAuthentication
|
|
|
|
include SharedPaths
|
|
|
|
include SharedAdmin
|
|
|
|
|
2014-09-21 17:40:22 -04:00
|
|
|
step 'I should see all projects' do
|
2013-01-09 00:14:05 -05:00
|
|
|
Project.all.each do |p|
|
|
|
|
page.should have_content p.name_with_namespace
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-09-21 17:40:22 -04:00
|
|
|
step 'I click on first project' do
|
2013-01-09 00:14:05 -05:00
|
|
|
click_link Project.first.name_with_namespace
|
|
|
|
end
|
|
|
|
|
2014-09-21 17:40:22 -04:00
|
|
|
step 'I should see project details' do
|
2013-01-09 00:14:05 -05:00
|
|
|
project = Project.first
|
2015-01-24 13:02:58 -05:00
|
|
|
current_path.should == admin_namespace_project_path(project.namespace, project)
|
2013-01-09 00:14:05 -05:00
|
|
|
page.should have_content(project.name_with_namespace)
|
|
|
|
page.should have_content(project.creator.name)
|
|
|
|
end
|
2014-06-19 06:20:42 -04:00
|
|
|
|
|
|
|
step 'I visit admin project page' do
|
2015-01-24 13:02:58 -05:00
|
|
|
visit admin_namespace_project_path(project.namespace, project)
|
2014-06-19 06:20:42 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
step 'I transfer project to group \'Web\'' do
|
2015-01-24 13:02:58 -05:00
|
|
|
find(:xpath, "//input[@id='new_namespace_id']").set group.id
|
2014-06-19 06:20:42 -04:00
|
|
|
click_button 'Transfer'
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'group \'Web\'' do
|
|
|
|
create(:group, name: 'Web')
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I should see project transfered' do
|
|
|
|
page.should have_content 'Web / ' + project.name
|
|
|
|
page.should have_content 'Namespace: Web'
|
|
|
|
end
|
|
|
|
|
|
|
|
def project
|
|
|
|
@project ||= Project.first
|
|
|
|
end
|
|
|
|
|
|
|
|
def group
|
|
|
|
Group.find_by(name: 'Web')
|
|
|
|
end
|
2013-01-09 00:14:05 -05:00
|
|
|
end
|