projects.rb 1.13 KB
Newer Older
1
class Spinach::Features::AdminProjects < Spinach::FeatureSteps
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
  include SharedAuthentication
  include SharedPaths
  include SharedAdmin

  And 'I should see all projects' do
    Project.all.each do |p|
      page.should have_content p.name_with_namespace
    end
  end

  And 'I click on first project' do
    click_link Project.first.name_with_namespace
  end

  Then 'I should see project details' do
    project = Project.first
    current_path.should == admin_project_path(project)
    page.should have_content(project.name_with_namespace)
    page.should have_content(project.creator.name)
  end
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47

  step 'I visit admin project page' do
    visit admin_project_path(project)
  end

  step 'I transfer project to group \'Web\'' do
    find(:xpath, "//input[@id='namespace_id']").set group.id
    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
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
48
end