2014-10-02 12:42:54 -04:00
|
|
|
class Spinach::Features::ExploreProjects < Spinach::FeatureSteps
|
2013-11-06 10:13:21 -05:00
|
|
|
include SharedAuthentication
|
2013-07-29 10:07:03 -04:00
|
|
|
include SharedPaths
|
2013-11-06 10:13:21 -05:00
|
|
|
include SharedProject
|
2013-07-29 10:07:03 -04:00
|
|
|
|
2013-09-20 11:39:12 -04:00
|
|
|
step 'I should see project "Empty Public Project"' do
|
2015-06-12 00:44:13 -04:00
|
|
|
expect(page).to have_content "Empty Public Project"
|
2013-09-20 11:39:12 -04:00
|
|
|
end
|
|
|
|
|
2013-07-29 10:07:03 -04:00
|
|
|
step 'I should see public project details' do
|
2015-06-12 00:44:13 -04:00
|
|
|
expect(page).to have_content '32 branches'
|
|
|
|
expect(page).to have_content '16 tags'
|
2013-07-29 10:07:03 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
step 'I should see project readme' do
|
2015-06-12 00:44:13 -04:00
|
|
|
expect(page).to have_content 'README.md'
|
2013-07-29 10:07:03 -04:00
|
|
|
end
|
|
|
|
|
2013-09-20 11:39:12 -04:00
|
|
|
step 'I should see empty public project details' do
|
2015-06-12 00:44:13 -04:00
|
|
|
expect(page).to have_content 'Git global setup'
|
2013-09-20 11:39:12 -04:00
|
|
|
end
|
|
|
|
|
2013-12-03 21:13:19 -05:00
|
|
|
step 'I should see empty public project details with http clone info' do
|
2014-01-19 13:55:59 -05:00
|
|
|
project = Project.find_by(name: 'Empty Public Project')
|
2015-06-01 17:43:59 -04:00
|
|
|
page.all(:css, '.git-empty .clone').each do |element|
|
2015-06-12 00:44:13 -04:00
|
|
|
expect(element.text).to include(project.http_url_to_repo)
|
2013-12-03 21:13:19 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I should see empty public project details with ssh clone info' do
|
2014-01-19 13:55:59 -05:00
|
|
|
project = Project.find_by(name: 'Empty Public Project')
|
2015-06-01 17:43:59 -04:00
|
|
|
page.all(:css, '.git-empty .clone').each do |element|
|
2015-06-12 00:44:13 -04:00
|
|
|
expect(element.text).to include(project.url_to_repo)
|
2013-12-03 21:13:19 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2013-09-24 15:14:28 -04:00
|
|
|
step 'I should see project "Community" home page' do
|
2015-06-12 01:36:00 -04:00
|
|
|
page.within '.navbar-gitlab .title' do
|
2015-06-12 00:44:13 -04:00
|
|
|
expect(page).to have_content 'Community'
|
2013-10-21 07:06:17 -04:00
|
|
|
end
|
2013-09-24 15:14:28 -04:00
|
|
|
end
|
|
|
|
|
2013-11-06 10:13:21 -05:00
|
|
|
step 'I should see project "Internal" home page' do
|
2015-06-12 01:36:00 -04:00
|
|
|
page.within '.navbar-gitlab .title' do
|
2015-06-12 00:44:13 -04:00
|
|
|
expect(page).to have_content 'Internal'
|
2013-11-06 10:13:21 -05:00
|
|
|
end
|
2013-07-29 10:07:03 -04:00
|
|
|
end
|
2013-11-28 16:46:55 -05:00
|
|
|
|
2013-12-03 21:13:19 -05:00
|
|
|
step 'I should see an http link to the repository' do
|
2014-01-19 13:55:59 -05:00
|
|
|
project = Project.find_by(name: 'Community')
|
2015-06-12 00:44:13 -04:00
|
|
|
expect(page).to have_field('project_clone', with: project.http_url_to_repo)
|
2013-11-28 16:46:55 -05:00
|
|
|
end
|
|
|
|
|
2013-12-03 21:13:19 -05:00
|
|
|
step 'I should see an ssh link to the repository' do
|
2014-01-19 13:55:59 -05:00
|
|
|
project = Project.find_by(name: 'Community')
|
2015-06-12 00:44:13 -04:00
|
|
|
expect(page).to have_field('project_clone', with: project.url_to_repo)
|
2013-11-28 16:46:55 -05:00
|
|
|
end
|
2014-02-01 11:47:54 -05:00
|
|
|
|
|
|
|
step 'I visit "Community" issues page' do
|
|
|
|
create(:issue,
|
|
|
|
title: "Bug",
|
2014-02-03 07:59:20 -05:00
|
|
|
project: public_project
|
2014-02-01 11:47:54 -05:00
|
|
|
)
|
|
|
|
create(:issue,
|
|
|
|
title: "New feature",
|
2014-02-03 07:59:20 -05:00
|
|
|
project: public_project
|
2014-02-01 11:47:54 -05:00
|
|
|
)
|
2015-01-24 13:02:58 -05:00
|
|
|
visit namespace_project_issues_path(public_project.namespace, public_project)
|
2014-02-01 11:47:54 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
step 'I should see list of issues for "Community" project' do
|
2015-06-12 00:44:13 -04:00
|
|
|
expect(page).to have_content "Bug"
|
|
|
|
expect(page).to have_content public_project.name
|
|
|
|
expect(page).to have_content "New feature"
|
2014-02-01 11:47:54 -05:00
|
|
|
end
|
2014-02-01 18:59:48 -05:00
|
|
|
|
|
|
|
step 'I visit "Internal" issues page' do
|
|
|
|
create(:issue,
|
|
|
|
title: "Internal Bug",
|
2014-02-03 07:59:20 -05:00
|
|
|
project: internal_project
|
2014-02-01 18:59:48 -05:00
|
|
|
)
|
|
|
|
create(:issue,
|
|
|
|
title: "New internal feature",
|
2014-02-03 07:59:20 -05:00
|
|
|
project: internal_project
|
2014-02-01 18:59:48 -05:00
|
|
|
)
|
2015-01-24 13:02:58 -05:00
|
|
|
visit namespace_project_issues_path(internal_project.namespace, internal_project)
|
2014-02-01 18:59:48 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
step 'I should see list of issues for "Internal" project' do
|
2015-06-12 00:44:13 -04:00
|
|
|
expect(page).to have_content "Internal Bug"
|
|
|
|
expect(page).to have_content internal_project.name
|
|
|
|
expect(page).to have_content "New internal feature"
|
2014-02-01 18:59:48 -05:00
|
|
|
end
|
2014-02-02 10:32:12 -05:00
|
|
|
|
|
|
|
step 'I visit "Community" merge requests page' do
|
2015-01-24 13:02:58 -05:00
|
|
|
visit namespace_project_merge_requests_path(public_project.namespace, public_project)
|
2014-02-03 07:59:20 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
step 'project "Community" has "Bug fix" open merge request' do
|
2014-02-02 10:32:12 -05:00
|
|
|
create(:merge_request,
|
2014-02-03 07:59:20 -05:00
|
|
|
title: "Bug fix for public project",
|
|
|
|
source_project: public_project,
|
|
|
|
target_project: public_project,
|
2014-02-02 10:32:12 -05:00
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I should see list of merge requests for "Community" project' do
|
2015-06-12 00:44:13 -04:00
|
|
|
expect(page).to have_content public_project.name
|
|
|
|
expect(page).to have_content public_merge_request.source_project.name
|
2014-02-02 10:32:12 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
step 'I visit "Internal" merge requests page' do
|
2015-01-24 13:02:58 -05:00
|
|
|
visit namespace_project_merge_requests_path(internal_project.namespace, internal_project)
|
2014-02-03 07:59:20 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
step 'project "Internal" has "Feature implemented" open merge request' do
|
2014-02-02 10:32:12 -05:00
|
|
|
create(:merge_request,
|
2014-02-03 07:59:20 -05:00
|
|
|
title: "Feature implemented",
|
|
|
|
source_project: internal_project,
|
|
|
|
target_project: internal_project
|
2014-02-02 10:32:12 -05:00
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I should see list of merge requests for "Internal" project' do
|
2015-06-12 00:44:13 -04:00
|
|
|
expect(page).to have_content internal_project.name
|
|
|
|
expect(page).to have_content internal_merge_request.source_project.name
|
2014-02-03 07:59:20 -05:00
|
|
|
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
|
2014-02-02 10:32:12 -05:00
|
|
|
|
2014-02-03 07:59:20 -05:00
|
|
|
def public_merge_request
|
|
|
|
@public_merge_request ||= MergeRequest.find_by!(title: 'Bug fix for public project')
|
2014-02-02 10:32:12 -05:00
|
|
|
end
|
2013-07-29 10:07:03 -04:00
|
|
|
end
|