BigW Consortium Gitlab

projects.rb 1.19 KB
Newer Older
1
class Spinach::Features::AdminProjects < Spinach::FeatureSteps
2 3 4 5
  include SharedAuthentication
  include SharedPaths
  include SharedAdmin

6
  step 'I should see all projects' do
7 8 9 10 11
    Project.all.each do |p|
      page.should have_content p.name_with_namespace
    end
  end

12
  step 'I click on first project' do
13 14 15
    click_link Project.first.name_with_namespace
  end

16
  step 'I should see project details' do
17
    project = Project.first
Vinnie Okada committed
18
    current_path.should == admin_namespace_project_path(project.namespace, project)
19 20 21
    page.should have_content(project.name_with_namespace)
    page.should have_content(project.creator.name)
  end
22 23

  step 'I visit admin project page' do
Vinnie Okada committed
24
    visit admin_namespace_project_path(project.namespace, project)
25 26 27
  end

  step 'I transfer project to group \'Web\'' do
Vinnie Okada committed
28
    find(:xpath, "//input[@id='new_namespace_id']").set group.id
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
    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
48
end