debian-mirror-gitlab/features/steps/explore/projects.rb

146 lines
4.5 KiB
Ruby
Raw Normal View History

2015-04-26 12:48:37 +05:30
class Spinach::Features::ExploreProjects < Spinach::FeatureSteps
2014-09-02 18:07:02 +05:30
include SharedAuthentication
include SharedPaths
include SharedProject
2015-12-23 02:04:40 +05:30
include SharedUser
2014-09-02 18:07:02 +05:30
step 'I should see project "Empty Public Project"' do
2015-09-11 14:41:01 +05:30
expect(page).to have_content "Empty Public Project"
2014-09-02 18:07:02 +05:30
end
step 'I should see public project details' do
2015-09-11 14:41:01 +05:30
expect(page).to have_content '32 branches'
expect(page).to have_content '16 tags'
2014-09-02 18:07:02 +05:30
end
step 'I should see project readme' do
2015-09-11 14:41:01 +05:30
expect(page).to have_content 'README.md'
2014-09-02 18:07:02 +05:30
end
step 'I should see empty public project details' do
2016-06-02 11:05:42 +05:30
expect(page).not_to have_content 'Git global setup'
2014-09-02 18:07:02 +05:30
end
step 'I should see empty public project details with http clone info' do
project = Project.find_by(name: 'Empty Public Project')
2015-09-11 14:41:01 +05:30
page.all(:css, '.git-empty .clone').each do |element|
expect(element.text).to include(project.http_url_to_repo)
2014-09-02 18:07:02 +05:30
end
end
step 'I should see empty public project details with ssh clone info' do
project = Project.find_by(name: 'Empty Public Project')
2015-09-11 14:41:01 +05:30
page.all(:css, '.git-empty .clone').each do |element|
expect(element.text).to include(project.url_to_repo)
2014-09-02 18:07:02 +05:30
end
end
step 'I should see project "Community" home page' do
2015-09-11 14:41:01 +05:30
page.within '.navbar-gitlab .title' do
expect(page).to have_content 'Community'
2014-09-02 18:07:02 +05:30
end
end
step 'I should see project "Internal" home page' do
2015-09-11 14:41:01 +05:30
page.within '.navbar-gitlab .title' do
expect(page).to have_content 'Internal'
2014-09-02 18:07:02 +05:30
end
end
step 'I should see an http link to the repository' do
project = Project.find_by(name: 'Community')
2015-09-11 14:41:01 +05:30
expect(page).to have_field('project_clone', with: project.http_url_to_repo)
2014-09-02 18:07:02 +05:30
end
step 'I should see an ssh link to the repository' do
project = Project.find_by(name: 'Community')
2015-09-11 14:41:01 +05:30
expect(page).to have_field('project_clone', with: project.url_to_repo)
2014-09-02 18:07:02 +05:30
end
step 'I visit "Community" issues page' do
create(:issue,
title: "Bug",
project: public_project
2015-12-23 02:04:40 +05:30
)
2014-09-02 18:07:02 +05:30
create(:issue,
title: "New feature",
project: public_project
2015-12-23 02:04:40 +05:30
)
2015-04-26 12:48:37 +05:30
visit namespace_project_issues_path(public_project.namespace, public_project)
2014-09-02 18:07:02 +05:30
end
step 'I should see list of issues for "Community" project' do
2015-09-11 14:41:01 +05:30
expect(page).to have_content "Bug"
expect(page).to have_content public_project.name
expect(page).to have_content "New feature"
2014-09-02 18:07:02 +05:30
end
step 'I visit "Internal" issues page' do
create(:issue,
title: "Internal Bug",
project: internal_project
2015-12-23 02:04:40 +05:30
)
2014-09-02 18:07:02 +05:30
create(:issue,
title: "New internal feature",
project: internal_project
2015-12-23 02:04:40 +05:30
)
2015-04-26 12:48:37 +05:30
visit namespace_project_issues_path(internal_project.namespace, internal_project)
2014-09-02 18:07:02 +05:30
end
step 'I should see list of issues for "Internal" project' do
2015-09-11 14:41:01 +05:30
expect(page).to have_content "Internal Bug"
expect(page).to have_content internal_project.name
expect(page).to have_content "New internal feature"
2014-09-02 18:07:02 +05:30
end
step 'I visit "Community" merge requests page' do
2015-04-26 12:48:37 +05:30
visit namespace_project_merge_requests_path(public_project.namespace, public_project)
2014-09-02 18:07:02 +05:30
end
step 'project "Community" has "Bug fix" open merge request' do
create(:merge_request,
title: "Bug fix for public project",
source_project: public_project,
target_project: public_project,
2015-12-23 02:04:40 +05:30
)
2014-09-02 18:07:02 +05:30
end
step 'I should see list of merge requests for "Community" project' do
2015-09-11 14:41:01 +05:30
expect(page).to have_content public_project.name
expect(page).to have_content public_merge_request.source_project.name
2014-09-02 18:07:02 +05:30
end
step 'I visit "Internal" merge requests page' do
2015-04-26 12:48:37 +05:30
visit namespace_project_merge_requests_path(internal_project.namespace, internal_project)
2014-09-02 18:07:02 +05:30
end
step 'project "Internal" has "Feature implemented" open merge request' do
create(:merge_request,
title: "Feature implemented",
source_project: internal_project,
target_project: internal_project
2015-12-23 02:04:40 +05:30
)
2014-09-02 18:07:02 +05:30
end
step 'I should see list of merge requests for "Internal" project' do
2015-09-11 14:41:01 +05:30
expect(page).to have_content internal_project.name
expect(page).to have_content internal_merge_request.source_project.name
2014-09-02 18:07:02 +05:30
end
def internal_project
@internal_project ||= Project.find_by!(name: 'Internal')
end
def public_project
@public_project ||= Project.find_by!(name: 'Community')
end
def internal_merge_request
@internal_merge_request ||= MergeRequest.find_by!(title: 'Feature implemented')
end
def public_merge_request
@public_merge_request ||= MergeRequest.find_by!(title: 'Bug fix for public project')
end
end