2015-04-26 12:48:37 +05:30
|
|
|
class Spinach::Features::Dashboard < Spinach::FeatureSteps
|
2014-09-02 18:07:02 +05:30
|
|
|
include SharedAuthentication
|
|
|
|
include SharedPaths
|
|
|
|
include SharedProject
|
2016-04-02 18:10:28 +05:30
|
|
|
include SharedIssuable
|
2014-09-02 18:07:02 +05:30
|
|
|
|
2015-04-26 12:48:37 +05:30
|
|
|
step 'I should see "New Project" link' do
|
2015-09-11 14:41:01 +05:30
|
|
|
expect(page).to have_link "New project"
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
|
|
|
|
2015-04-26 12:48:37 +05:30
|
|
|
step 'I should see "Shop" project link' do
|
2015-09-11 14:41:01 +05:30
|
|
|
expect(page).to have_link "Shop"
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
|
|
|
|
2015-10-24 18:46:33 +05:30
|
|
|
step 'I should see "Shop" project CI status' do
|
2016-06-02 11:05:42 +05:30
|
|
|
expect(page).to have_link "Commit: skipped"
|
2015-10-24 18:46:33 +05:30
|
|
|
end
|
|
|
|
|
2015-04-26 12:48:37 +05:30
|
|
|
step 'I should see last push widget' do
|
2015-09-11 14:41:01 +05:30
|
|
|
expect(page).to have_content "You pushed to fix"
|
2017-08-17 22:00:37 +05:30
|
|
|
expect(page).to have_link "Create merge request"
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
|
|
|
|
2017-08-17 22:00:37 +05:30
|
|
|
step 'I click "Create merge request" link' do
|
|
|
|
click_link "Create merge request"
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
|
|
|
|
2015-04-26 12:48:37 +05:30
|
|
|
step 'I see prefilled new Merge Request page' do
|
2016-09-13 17:45:13 +05:30
|
|
|
expect(page).to have_selector('.merge-request-form')
|
2015-09-11 14:41:01 +05:30
|
|
|
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"
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
|
|
|
|
2015-04-26 12:48:37 +05:30
|
|
|
step 'I have group with projects' do
|
2014-09-02 18:07:02 +05:30
|
|
|
@group = create(:group)
|
2017-08-17 22:00:37 +05:30
|
|
|
@project = create(:empty_project, namespace: @group)
|
2014-09-02 18:07:02 +05:30
|
|
|
@event = create(:closed_issue_event, project: @project)
|
|
|
|
|
|
|
|
@project.team << [current_user, :master]
|
|
|
|
end
|
|
|
|
|
2015-04-26 12:48:37 +05:30
|
|
|
step 'I should see projects list' do
|
2014-09-02 18:07:02 +05:30
|
|
|
@user.authorized_projects.all.each do |project|
|
2015-09-11 14:41:01 +05:30
|
|
|
expect(page).to have_link project.name_with_namespace
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2015-04-26 12:48:37 +05:30
|
|
|
step 'I should see groups list' do
|
2014-09-02 18:07:02 +05:30
|
|
|
Group.all.each do |group|
|
2015-09-11 14:41:01 +05:30
|
|
|
expect(page).to have_link group.name
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2015-04-26 12:48:37 +05:30
|
|
|
step 'group has a projects that does not belongs to me' do
|
2017-08-17 22:00:37 +05:30
|
|
|
@forbidden_project1 = create(:empty_project, group: @group)
|
|
|
|
@forbidden_project2 = create(:empty_project, group: @group)
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
|
|
|
|
2015-04-26 12:48:37 +05:30
|
|
|
step 'I should see 1 project at group list' do
|
2015-09-11 14:41:01 +05:30
|
|
|
expect(find('span.last_activity/span')).to have_content('1')
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
2016-06-02 11:05:42 +05:30
|
|
|
|
|
|
|
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")
|
2017-08-17 22:00:37 +05:30
|
|
|
issue = create(:issue, title: "Bugfix1", project: project, assignees: [current_user])
|
2016-06-02 11:05:42 +05:30
|
|
|
issue.labels << project.labels.find_by(title: 'feature')
|
|
|
|
end
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|