2015-04-26 12:48:37 +05:30
|
|
|
class Spinach::Features::ProjectIssues < Spinach::FeatureSteps
|
|
|
|
include SharedAuthentication
|
|
|
|
include SharedIssuable
|
|
|
|
include SharedProject
|
|
|
|
include SharedNote
|
|
|
|
include SharedPaths
|
|
|
|
include SharedMarkdown
|
2016-06-02 11:05:42 +05:30
|
|
|
include SharedUser
|
2015-04-26 12:48:37 +05:30
|
|
|
|
|
|
|
step 'I should not see "Release 0.3" in issues' do
|
2015-09-11 14:41:01 +05:30
|
|
|
expect(page).not_to have_content "Release 0.3"
|
2015-04-26 12:48:37 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
step 'I click link "Closed"' do
|
2017-09-10 17:25:29 +05:30
|
|
|
find('.issues-state-filters [data-state="closed"] span', text: 'Closed').click
|
2015-04-26 12:48:37 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
step 'I should see "Release 0.3" in issues' do
|
2015-09-11 14:41:01 +05:30
|
|
|
expect(page).to have_content "Release 0.3"
|
2015-04-26 12:48:37 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
step 'I should not see "Release 0.4" in issues' do
|
2015-09-11 14:41:01 +05:30
|
|
|
expect(page).not_to have_content "Release 0.4"
|
2015-04-26 12:48:37 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
step 'I click link "All"' do
|
2017-09-10 17:25:29 +05:30
|
|
|
find('.issues-state-filters [data-state="all"] span', text: 'All').click
|
2016-09-13 17:45:13 +05:30
|
|
|
# Waits for load
|
|
|
|
expect(find('.issues-state-filters > .active')).to have_content 'All'
|
2015-04-26 12:48:37 +05:30
|
|
|
end
|
|
|
|
|
2016-04-02 18:10:28 +05:30
|
|
|
step 'I should see issue "Tweet control"' do
|
|
|
|
expect(page).to have_content "Tweet control"
|
|
|
|
end
|
|
|
|
|
2015-04-26 12:48:37 +05:30
|
|
|
step 'I click "author" dropdown' do
|
2016-06-02 11:05:42 +05:30
|
|
|
page.find('.js-author-search').click
|
|
|
|
sleep 1
|
2015-04-26 12:48:37 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
step 'I see current user as the first user' do
|
2016-06-02 11:05:42 +05:30
|
|
|
expect(page).to have_selector('.dropdown-content', visible: true)
|
|
|
|
users = page.all('.dropdown-menu-author .dropdown-content li a')
|
2016-01-14 18:37:52 +05:30
|
|
|
expect(users[0].text).to eq 'Any Author'
|
2016-06-02 11:05:42 +05:30
|
|
|
expect(users[1].text).to eq "#{current_user.name} #{current_user.to_reference}"
|
2015-04-26 12:48:37 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
step 'I click link "500 error on profile"' do
|
|
|
|
click_link "500 error on profile"
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I should see label \'bug\' with issue' do
|
2015-12-23 02:04:40 +05:30
|
|
|
page.within '.issuable-show-labels' do
|
2015-09-11 14:41:01 +05:30
|
|
|
expect(page).to have_content 'bug'
|
2015-04-26 12:48:37 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I fill in issue search with "Re"' do
|
|
|
|
filter_issue "Re"
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I fill in issue search with "Bu"' do
|
|
|
|
filter_issue "Bu"
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I fill in issue search with ".3"' do
|
|
|
|
filter_issue ".3"
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I fill in issue search with "Something"' do
|
|
|
|
filter_issue "Something"
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I fill in issue search with ""' do
|
|
|
|
filter_issue ""
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'project "Shop" has milestone "v2.2"' do
|
|
|
|
milestone = create(:milestone, title: "v2.2", project: project)
|
|
|
|
|
|
|
|
3.times { create(:issue, project: project, milestone: milestone) }
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'project "Shop" has milestone "v3.0"' do
|
|
|
|
milestone = create(:milestone, title: "v3.0", project: project)
|
|
|
|
|
|
|
|
3.times { create(:issue, project: project, milestone: milestone) }
|
|
|
|
end
|
|
|
|
|
|
|
|
When 'I select milestone "v3.0"' do
|
|
|
|
select "v3.0", from: "milestone_id"
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I should see selected milestone with title "v3.0"' do
|
|
|
|
issues_milestone_selector = "#issue_milestone_id_chzn > a"
|
2015-09-11 14:41:01 +05:30
|
|
|
expect(find(issues_milestone_selector)).to have_content("v3.0")
|
2015-04-26 12:48:37 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
When 'I select first assignee from "Shop" project' do
|
|
|
|
first_assignee = project.users.first
|
|
|
|
select first_assignee.name, from: "assignee_id"
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I should see first assignee from "Shop" as selected assignee' do
|
|
|
|
issues_assignee_selector = "#issue_assignee_id_chzn > a"
|
|
|
|
|
|
|
|
assignee_name = project.users.first.name
|
2015-09-11 14:41:01 +05:30
|
|
|
expect(find(issues_assignee_selector)).to have_content(assignee_name)
|
2015-04-26 12:48:37 +05:30
|
|
|
end
|
|
|
|
|
2016-04-02 18:10:28 +05:30
|
|
|
step 'The list should be sorted by "Least popular"' do
|
|
|
|
page.within '.issues-list' do
|
|
|
|
page.within 'li.issue:nth-child(1)' do
|
|
|
|
expect(page).to have_content 'Tweet control'
|
|
|
|
expect(page).to have_content '1 2'
|
|
|
|
end
|
|
|
|
|
|
|
|
page.within 'li.issue:nth-child(2)' do
|
|
|
|
expect(page).to have_content 'Release 0.4'
|
|
|
|
expect(page).to have_content '2 1'
|
|
|
|
end
|
|
|
|
|
|
|
|
page.within 'li.issue:nth-child(3)' do
|
|
|
|
expect(page).to have_content 'Bugfix'
|
2016-06-16 23:09:34 +05:30
|
|
|
expect(page).not_to have_content '0 0'
|
2016-04-02 18:10:28 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2015-04-26 12:48:37 +05:30
|
|
|
When 'I visit empty project page' do
|
|
|
|
project = Project.find_by(name: 'Empty Project')
|
2017-09-10 17:25:29 +05:30
|
|
|
visit project_path(project)
|
2015-04-26 12:48:37 +05:30
|
|
|
end
|
|
|
|
|
2015-09-11 14:41:01 +05:30
|
|
|
When "I visit project \"Community\" issues page" do
|
|
|
|
project = Project.find_by(name: 'Community')
|
2017-09-10 17:25:29 +05:30
|
|
|
visit project_issues_path(project)
|
2015-09-11 14:41:01 +05:30
|
|
|
end
|
|
|
|
|
2015-04-26 12:48:37 +05:30
|
|
|
step 'project \'Shop\' has issue \'Bugfix1\' with description: \'Description for issue1\'' do
|
2015-10-24 18:46:33 +05:30
|
|
|
create(:issue, title: 'Bugfix1', description: 'Description for issue1', project: project)
|
2015-04-26 12:48:37 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
step 'project \'Shop\' has issue \'Feature1\' with description: \'Feature submitted for issue1\'' do
|
2015-10-24 18:46:33 +05:30
|
|
|
create(:issue, title: 'Feature1', description: 'Feature submitted for issue1', project: project)
|
2015-04-26 12:48:37 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
step 'I fill in issue search with \'Description for issue1\'' do
|
|
|
|
filter_issue 'Description for issue'
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I fill in issue search with \'issue1\'' do
|
|
|
|
filter_issue 'issue1'
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I fill in issue search with \'Rock and roll\'' do
|
2016-09-13 17:45:13 +05:30
|
|
|
filter_issue 'Rock and roll'
|
2015-04-26 12:48:37 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
step 'I should see \'Bugfix1\' in issues' do
|
2015-09-11 14:41:01 +05:30
|
|
|
expect(page).to have_content 'Bugfix1'
|
2015-04-26 12:48:37 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
step 'I should see \'Feature1\' in issues' do
|
2015-09-11 14:41:01 +05:30
|
|
|
expect(page).to have_content 'Feature1'
|
2015-04-26 12:48:37 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
step 'I should not see \'Bugfix1\' in issues' do
|
2015-09-11 14:41:01 +05:30
|
|
|
expect(page).not_to have_content 'Bugfix1'
|
2015-04-26 12:48:37 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
def filter_issue(text)
|
2016-09-29 09:46:39 +05:30
|
|
|
fill_in 'issuable_search', with: text
|
2015-04-26 12:48:37 +05:30
|
|
|
end
|
|
|
|
end
|