2012-09-10 12:34:01 +00:00
|
|
|
class ProjectIssues < Spinach::FeatureSteps
|
2012-09-10 15:35:03 +00:00
|
|
|
include SharedAuthentication
|
|
|
|
include SharedProject
|
|
|
|
include SharedNote
|
|
|
|
include SharedPaths
|
2014-02-04 07:48:33 +00:00
|
|
|
include SharedMarkdown
|
2012-09-10 15:35:03 +00:00
|
|
|
|
2012-09-10 12:34:01 +00:00
|
|
|
Given 'I should see "Release 0.4" in issues' do
|
|
|
|
page.should have_content "Release 0.4"
|
|
|
|
end
|
|
|
|
|
|
|
|
And 'I should not see "Release 0.3" in issues' do
|
|
|
|
page.should_not have_content "Release 0.3"
|
|
|
|
end
|
|
|
|
|
2013-09-27 13:25:24 +00:00
|
|
|
And 'I should not see "Tweet control" in issues' do
|
|
|
|
page.should_not have_content "Tweet control"
|
2013-09-26 16:05:55 +00:00
|
|
|
end
|
|
|
|
|
2012-09-10 12:34:01 +00:00
|
|
|
Given 'I click link "Closed"' do
|
|
|
|
click_link "Closed"
|
|
|
|
end
|
|
|
|
|
|
|
|
Then 'I should see "Release 0.3" in issues' do
|
|
|
|
page.should have_content "Release 0.3"
|
|
|
|
end
|
|
|
|
|
|
|
|
And 'I should not see "Release 0.4" in issues' do
|
|
|
|
page.should_not have_content "Release 0.4"
|
|
|
|
end
|
|
|
|
|
|
|
|
Given 'I click link "All"' do
|
|
|
|
click_link "All"
|
|
|
|
end
|
|
|
|
|
|
|
|
Given 'I click link "Release 0.4"' do
|
|
|
|
click_link "Release 0.4"
|
|
|
|
end
|
|
|
|
|
|
|
|
Then 'I should see issue "Release 0.4"' do
|
|
|
|
page.should have_content "Release 0.4"
|
|
|
|
end
|
|
|
|
|
|
|
|
Given 'I click link "New Issue"' do
|
|
|
|
click_link "New Issue"
|
|
|
|
end
|
|
|
|
|
|
|
|
And 'I submit new issue "500 error on profile"' do
|
2013-05-05 14:01:10 +00:00
|
|
|
fill_in "issue_title", with: "500 error on profile"
|
2012-09-10 12:34:01 +00:00
|
|
|
click_button "Submit new issue"
|
|
|
|
end
|
|
|
|
|
2014-07-31 11:14:27 +00:00
|
|
|
step 'I submit new issue "500 error on profile" with label \'bug\'' do
|
|
|
|
fill_in "issue_title", with: "500 error on profile"
|
|
|
|
select 'bug', from: "Labels"
|
|
|
|
click_button "Submit new issue"
|
|
|
|
end
|
|
|
|
|
2012-09-10 12:34:01 +00:00
|
|
|
Given 'I click link "500 error on profile"' do
|
|
|
|
click_link "500 error on profile"
|
|
|
|
end
|
|
|
|
|
2014-07-31 11:14:27 +00:00
|
|
|
step 'I should see label \'bug\' with issue' do
|
|
|
|
within '.issue-show-labels' do
|
|
|
|
page.should have_content 'bug'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2012-09-10 12:34:01 +00:00
|
|
|
Then 'I should see issue "500 error on profile"' do
|
2014-01-19 18:55:59 +00:00
|
|
|
issue = Issue.find_by(title: "500 error on profile")
|
2012-09-10 12:34:01 +00:00
|
|
|
page.should have_content issue.title
|
|
|
|
page.should have_content issue.author_name
|
|
|
|
page.should have_content issue.project.name
|
|
|
|
end
|
|
|
|
|
2013-09-27 13:25:24 +00:00
|
|
|
Given 'I fill in issue search with "Re"' do
|
|
|
|
fill_in 'issue_search', with: "Re"
|
2012-09-10 12:34:01 +00:00
|
|
|
end
|
|
|
|
|
2013-09-27 13:25:24 +00:00
|
|
|
Given 'I fill in issue search with "Bu"' do
|
|
|
|
fill_in 'issue_search', with: "Bu"
|
2012-09-10 12:34:01 +00:00
|
|
|
end
|
|
|
|
|
2013-09-27 13:25:24 +00:00
|
|
|
And 'I fill in issue search with ".3"' do
|
|
|
|
fill_in 'issue_search', with: ".3"
|
2012-09-10 12:34:01 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
And 'I fill in issue search with "Something"' do
|
|
|
|
fill_in 'issue_search', with: "Something"
|
|
|
|
end
|
|
|
|
|
|
|
|
And 'I fill in issue search with ""' do
|
|
|
|
fill_in 'issue_search', with: ""
|
|
|
|
end
|
|
|
|
|
|
|
|
Given 'project "Shop" has milestone "v2.2"' do
|
2014-01-19 18:55:59 +00:00
|
|
|
project = Project.find_by(name: "Shop")
|
2013-05-05 14:01:10 +00:00
|
|
|
milestone = create(:milestone, title: "v2.2", project: project)
|
2012-09-10 12:34:01 +00:00
|
|
|
|
2013-05-05 14:01:10 +00:00
|
|
|
3.times { create(:issue, project: project, milestone: milestone) }
|
2012-09-10 12:34:01 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
And 'project "Shop" has milestone "v3.0"' do
|
2014-01-19 18:55:59 +00:00
|
|
|
project = Project.find_by(name: "Shop")
|
2013-05-05 14:01:10 +00:00
|
|
|
milestone = create(:milestone, title: "v3.0", project: project)
|
2012-09-10 12:34:01 +00:00
|
|
|
|
2013-05-05 14:01:10 +00:00
|
|
|
3.times { create(:issue, project: project, milestone: milestone) }
|
2012-09-10 12:34:01 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
When 'I select milestone "v3.0"' do
|
|
|
|
select "v3.0", from: "milestone_id"
|
|
|
|
end
|
|
|
|
|
|
|
|
Then 'I should see selected milestone with title "v3.0"' do
|
2012-12-19 03:14:05 +00:00
|
|
|
issues_milestone_selector = "#issue_milestone_id_chzn > a"
|
2012-09-10 12:34:01 +00:00
|
|
|
page.find(issues_milestone_selector).should have_content("v3.0")
|
|
|
|
end
|
|
|
|
|
|
|
|
When 'I select first assignee from "Shop" project' do
|
2014-01-19 18:55:59 +00:00
|
|
|
project = Project.find_by(name: "Shop")
|
2012-09-10 12:34:01 +00:00
|
|
|
first_assignee = project.users.first
|
|
|
|
select first_assignee.name, from: "assignee_id"
|
|
|
|
end
|
|
|
|
|
|
|
|
Then 'I should see first assignee from "Shop" as selected assignee' do
|
2012-12-19 03:14:05 +00:00
|
|
|
issues_assignee_selector = "#issue_assignee_id_chzn > a"
|
2014-01-19 18:55:59 +00:00
|
|
|
project = Project.find_by(name: "Shop")
|
2012-09-10 12:34:01 +00:00
|
|
|
assignee_name = project.users.first.name
|
|
|
|
page.find(issues_assignee_selector).should have_content(assignee_name)
|
|
|
|
end
|
|
|
|
|
|
|
|
And 'project "Shop" have "Release 0.4" open issue' do
|
2014-01-19 18:55:59 +00:00
|
|
|
project = Project.find_by(name: "Shop")
|
2012-11-06 03:31:55 +00:00
|
|
|
create(:issue,
|
2013-05-05 14:01:10 +00:00
|
|
|
title: "Release 0.4",
|
|
|
|
project: project,
|
2014-02-04 07:48:33 +00:00
|
|
|
author: project.users.first,
|
|
|
|
description: "# Description header"
|
|
|
|
)
|
2012-09-10 12:34:01 +00:00
|
|
|
end
|
|
|
|
|
2013-09-27 13:25:24 +00:00
|
|
|
And 'project "Shop" have "Tweet control" open issue' do
|
2014-01-19 18:55:59 +00:00
|
|
|
project = Project.find_by(name: "Shop")
|
2013-09-26 16:05:55 +00:00
|
|
|
create(:issue,
|
2013-09-27 13:25:24 +00:00
|
|
|
title: "Tweet control",
|
2013-09-26 16:05:55 +00:00
|
|
|
project: project,
|
|
|
|
author: project.users.first)
|
|
|
|
end
|
|
|
|
|
2012-09-10 12:34:01 +00:00
|
|
|
And 'project "Shop" have "Release 0.3" closed issue' do
|
2014-01-19 18:55:59 +00:00
|
|
|
project = Project.find_by(name: "Shop")
|
2013-02-18 10:43:08 +00:00
|
|
|
create(:closed_issue,
|
2013-05-05 14:01:10 +00:00
|
|
|
title: "Release 0.3",
|
|
|
|
project: project,
|
|
|
|
author: project.users.first)
|
2012-09-10 12:34:01 +00:00
|
|
|
end
|
2014-04-08 15:12:57 +00:00
|
|
|
|
|
|
|
Given 'empty project "Empty Project"' do
|
|
|
|
create :empty_project, name: 'Empty Project', namespace: @user.namespace
|
|
|
|
end
|
|
|
|
|
|
|
|
When 'I visit empty project page' do
|
|
|
|
project = Project.find_by(name: 'Empty Project')
|
|
|
|
visit project_path(project)
|
|
|
|
end
|
|
|
|
|
|
|
|
And 'I see empty project details with ssh clone info' do
|
|
|
|
project = Project.find_by(name: 'Empty Project')
|
|
|
|
page.all(:css, '.git-empty .clone').each do |element|
|
|
|
|
element.text.should include(project.url_to_repo)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
When "I visit empty project's issues page" do
|
|
|
|
project = Project.find_by(name: 'Empty Project')
|
|
|
|
visit project_issues_path(project)
|
|
|
|
end
|
2014-05-23 10:58:34 +00:00
|
|
|
|
|
|
|
step 'I leave a comment with code block' do
|
|
|
|
within(".js-main-target-form") do
|
|
|
|
fill_in "note[note]", with: "```\nCommand [1]: /usr/local/bin/git , see [text](doc/text)\n```"
|
|
|
|
click_button "Add Comment"
|
|
|
|
sleep 0.05
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'The code block should be unchanged' do
|
|
|
|
page.should have_content("```\nCommand [1]: /usr/local/bin/git , see [text](doc/text)\n```")
|
|
|
|
end
|
2014-08-15 19:51:43 +00:00
|
|
|
|
|
|
|
step 'project "Shop" has issue "Bugfix1" with description: "Description for issue1"' do
|
|
|
|
project = Project.find_by(name: "Shop")
|
|
|
|
issue = create(:issue, title: "Bugfix1", description: "Description for issue1", project: project)
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'project "Shop" has issue "Feature1" with description: "Feature submitted for issue1"' do
|
|
|
|
project = Project.find_by(name: "Shop")
|
|
|
|
issue = create(:issue, title: "Feature1", description: "Feature submitted for issue1", project: project)
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I fill in issue search with "Description for issue1"' do
|
|
|
|
fill_in 'issue_search', with: "Description for issue"
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I fill in issue search with "issue1"' do
|
|
|
|
fill_in 'issue_search', with: "issue1"
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I fill in issue search with "Rock and roll"' do
|
|
|
|
fill_in 'issue_search', with: "Description for issue"
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I should see "Bugfix1" in issues' do
|
|
|
|
page.should have_content "Bugfix1"
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I should see "Feature1" in issues' do
|
|
|
|
page.should have_content "Feature1"
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
step 'I should not see "Bugfix1" in issues' do
|
|
|
|
page.should_not have_content "Bugfix1"
|
|
|
|
end
|
2012-09-10 12:34:01 +00:00
|
|
|
end
|