projects_feature.rb 2.66 KB
Newer Older
1
class Spinach::Features::PublicProjectsFeature < Spinach::FeatureSteps
2
  include SharedAuthentication
3
  include SharedPaths
4
  include SharedProject
5 6 7 8 9 10 11 12 13

  step 'I should see project "Community"' do
    page.should have_content "Community"
  end

  step 'I should not see project "Enterprise"' do
    page.should_not have_content "Enterprise"
  end

14 15 16 17
  step 'I should see project "Empty Public Project"' do
    page.should have_content "Empty Public Project"
  end

18 19 20 21 22 23 24 25 26 27
  step 'I should see public project details' do
    page.should have_content '32 branches'
    page.should have_content '16 tags'
  end

  step 'I should see project readme' do
    page.should have_content 'README.md'
  end

  step 'public project "Community"' do
28
    create :project_with_code, name: 'Community', visibility_level: Gitlab::VisibilityLevel::PUBLIC
29 30
  end

31
  step 'public empty project "Empty Public Project"' do
32
    create :project, name: 'Empty Public Project', visibility_level: Gitlab::VisibilityLevel::PUBLIC
33 34
  end

35
  step 'I visit empty project page' do
36
    project = Project.find_by_name('Empty Public Project')
37 38 39 40 41 42
    visit project_path(project)
  end

  step 'I visit project "Community" page' do
    project = Project.find_by_name('Community')
    visit project_path(project)
43 44 45
  end

  step 'I should see empty public project details' do
46
    page.should have_content 'Git global setup'
47 48
  end

49 50 51 52
  step 'private project "Enterprise"' do
    create :project, name: 'Enterprise'
  end

53 54 55 56 57
  step 'I visit project "Enterprise" page' do
    project = Project.find_by_name('Enterprise')
    visit project_path(project)
  end

58
  step 'I should see project "Community" home page' do
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
59 60 61
    within '.project-home-title' do
      page.should have_content 'Community'
    end
62 63
  end

64 65 66
  step 'internal project "Internal"' do
    create :project_with_code, name: 'Internal', visibility_level: Gitlab::VisibilityLevel::INTERNAL
  end
67

68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
  step 'I should see project "Internal"' do
    page.should have_content "Internal"
  end

  step 'I should not see project "Internal"' do
    page.should_not have_content "Internal"
  end

  step 'I visit project "Internal" page' do
    project = Project.find_by_name('Internal')
    visit project_path(project)
  end

  step 'I should see project "Internal" home page' do
    within '.project-home-title' do
      page.should have_content 'Internal'
    end
85
  end
86 87 88 89 90 91 92 93 94 95

  Then 'I should see a http link to the repository' do
    project = Project.find_by_name 'Community'
    page.should have_field('project_clone', with: project.http_url_to_repo)
  end

  Then 'I should see a ssh link to the repository' do
    project = Project.find_by_name 'Community'
    page.should have_field('project_clone', with: project.url_to_repo)
  end
96 97
end