2014-09-22 10:30:25 -04:00
|
|
|
class Spinach::Features::Dashboard < Spinach::FeatureSteps
|
2012-09-10 11:35:03 -04:00
|
|
|
include SharedAuthentication
|
|
|
|
include SharedPaths
|
2013-01-09 00:14:05 -05:00
|
|
|
include SharedProject
|
2016-01-21 12:54:10 -05:00
|
|
|
include SharedIssuable
|
2012-09-10 11:35:03 -04:00
|
|
|
|
2014-09-21 17:40:22 -04:00
|
|
|
step 'I should see "New Project" link' do
|
2015-06-12 00:44:13 -04:00
|
|
|
expect(page).to have_link "New project"
|
2012-09-10 04:51:02 -04:00
|
|
|
end
|
|
|
|
|
2014-09-21 17:40:22 -04:00
|
|
|
step 'I should see "Shop" project link' do
|
2015-06-12 00:44:13 -04:00
|
|
|
expect(page).to have_link "Shop"
|
2012-09-10 04:51:02 -04:00
|
|
|
end
|
|
|
|
|
2015-09-24 08:00:23 -04:00
|
|
|
step 'I should see "Shop" project CI status' do
|
2016-05-14 15:51:57 -04:00
|
|
|
expect(page).to have_link "Commit: skipped"
|
2015-09-24 08:00:23 -04:00
|
|
|
end
|
|
|
|
|
2014-09-21 17:40:22 -04:00
|
|
|
step 'I should see last push widget' do
|
2015-06-12 00:44:13 -04:00
|
|
|
expect(page).to have_content "You pushed to fix"
|
|
|
|
expect(page).to have_link "Create Merge Request"
|
2012-09-10 04:51:02 -04:00
|
|
|
end
|
|
|
|
|
2014-09-21 17:40:22 -04:00
|
|
|
step 'I click "Create Merge Request" link' do
|
2012-09-10 04:51:02 -04:00
|
|
|
click_link "Create Merge Request"
|
|
|
|
end
|
|
|
|
|
2014-09-21 17:40:22 -04:00
|
|
|
step 'I see prefilled new Merge Request page' do
|
2016-08-12 05:10:59 -04:00
|
|
|
expect(page).to have_selector('.merge-request-form')
|
2015-06-12 00:44:13 -04:00
|
|
|
expect(current_path).to eq new_namespace_project_merge_request_path(@project.namespace, @project)
|
|
|
|
expect(find("#merge_request_target_project_id").value).to eq @project.id.to_s
|
|
|
|
expect(find("input#merge_request_source_branch").value).to eq "fix"
|
|
|
|
expect(find("input#merge_request_target_branch").value).to eq "master"
|
2012-09-10 04:51:02 -04:00
|
|
|
end
|
|
|
|
|
2014-09-21 17:40:22 -04:00
|
|
|
step 'I have group with projects' do
|
2012-11-05 22:31:55 -05:00
|
|
|
@group = create(:group)
|
2017-01-17 11:52:26 -05:00
|
|
|
@project = create(:empty_project, namespace: @group)
|
2012-11-05 22:31:55 -05:00
|
|
|
@event = create(:closed_issue_event, project: @project)
|
2012-10-03 16:46:55 -04:00
|
|
|
|
2013-01-04 01:43:25 -05:00
|
|
|
@project.team << [current_user, :master]
|
2012-10-03 16:46:55 -04:00
|
|
|
end
|
|
|
|
|
2014-09-21 17:40:22 -04:00
|
|
|
step 'I should see projects list' do
|
2013-01-27 08:41:35 -05:00
|
|
|
@user.authorized_projects.all.each do |project|
|
2015-06-12 00:44:13 -04:00
|
|
|
expect(page).to have_link project.name_with_namespace
|
2013-01-27 08:41:35 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-09-21 17:40:22 -04:00
|
|
|
step 'I should see groups list' do
|
2012-10-03 16:46:55 -04:00
|
|
|
Group.all.each do |group|
|
2015-06-12 00:44:13 -04:00
|
|
|
expect(page).to have_link group.name
|
2012-10-03 16:46:55 -04:00
|
|
|
end
|
|
|
|
end
|
2012-11-28 12:59:19 -05:00
|
|
|
|
2014-09-21 17:40:22 -04:00
|
|
|
step 'group has a projects that does not belongs to me' do
|
2017-01-17 11:52:26 -05:00
|
|
|
@forbidden_project1 = create(:empty_project, group: @group)
|
|
|
|
@forbidden_project2 = create(:empty_project, group: @group)
|
2012-11-28 12:59:19 -05:00
|
|
|
end
|
|
|
|
|
2014-09-21 17:40:22 -04:00
|
|
|
step 'I should see 1 project at group list' do
|
2015-06-12 00:44:13 -04:00
|
|
|
expect(find('span.last_activity/span')).to have_content('1')
|
2012-11-28 12:59:19 -05:00
|
|
|
end
|
2016-04-02 08:36:41 -04:00
|
|
|
|
|
|
|
step 'I filter the list by label "feature"' do
|
|
|
|
page.within ".labels-filter" do
|
|
|
|
find('.dropdown').click
|
|
|
|
click_link "feature"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I should see "Bugfix1" in issues list' do
|
|
|
|
page.within "ul.content-list" do
|
|
|
|
expect(page).to have_content "Bugfix1"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'project "Shop" has issue "Bugfix1" with label "feature"' do
|
|
|
|
project = Project.find_by(name: "Shop")
|
|
|
|
issue = create(:issue, title: "Bugfix1", project: project, assignee: current_user)
|
|
|
|
issue.labels << project.labels.find_by(title: 'feature')
|
|
|
|
end
|
2012-09-10 04:51:02 -04:00
|
|
|
end
|