Commit c1c93f4f authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fix tests and unassigned filter for issues. Updated CHANGELOG

parent d6c8eefb
......@@ -43,6 +43,9 @@ v 7.10.0 (unreleased)
- Link note avatar to user.
- Make Git-over-SSH errors more descriptive.
- Fix EmailsOnPush.
- Refactor issue filtering
- AJAX selectbox for issue assignee and author filters
- Fix issue with missing options in issue filtering dropdown if selected one
v 7.9.0
- Send EmailsOnPush email when branch or tag is created or deleted.
......
......@@ -19,7 +19,7 @@
require_relative 'projects_finder'
class IssuableFinder
NONE = 0
NONE = '0'
attr_accessor :current_user, :params
......
......@@ -36,7 +36,7 @@
Assign to
.col-sm-10
= users_select_tag("#{issuable.class.model_name.param_key}[assignee_id]",
placeholder: 'Select a user', class: 'custom-form-control',
placeholder: 'Select a user', class: 'custom-form-control', null_user: true,
selected: issuable.assignee_id)
 
= link_to 'Assign to me', '#', class: 'btn assign-to-me-link'
......
......@@ -10,10 +10,12 @@ Feature: Dashboard Issues
Scenario: I should see assigned issues
Then I should see issues assigned to me
@javascript
Scenario: I should see authored issues
When I click "Authored by me" link
Then I should see issues authored by me
@javascript
Scenario: I should see all issues
When I click "All" link
Then I should see all issues
......@@ -10,10 +10,12 @@ Feature: Dashboard Merge Requests
Scenario: I should see assigned merge_requests
Then I should see merge requests assigned to me
@javascript
Scenario: I should see authored merge_requests
When I click "Authored by me" link
Then I should see merge requests authored by me
@javascript
Scenario: I should see all merge_requests
When I click "All" link
Then I should see all merge requests
......@@ -8,11 +8,7 @@ Feature: Project Issues Filter Labels
And project "Shop" has issue "Feature1" with labels: "feature"
Given I visit project "Shop" issues page
Scenario: I should see project issues
Then I should see "bug" in labels filter
And I should see "feature" in labels filter
And I should see "enhancement" in labels filter
@javascript
Scenario: I filter by one label
Given I click link "bug"
Then I should see "Bugfix1" in issues list
......
class Spinach::Features::DashboardIssues < Spinach::FeatureSteps
include SharedAuthentication
include SharedPaths
include Select2Helper
step 'I should see issues assigned to me' do
should_see(assigned_issue)
......@@ -35,21 +36,13 @@ class Spinach::Features::DashboardIssues < Spinach::FeatureSteps
end
step 'I click "Authored by me" link' do
within ".assignee-filter" do
click_link "Any"
end
within ".author-filter" do
click_link current_user.name
end
select2(current_user.id, from: "#author_id")
select2(nil, from: "#assignee_id")
end
step 'I click "All" link' do
within ".author-filter" do
click_link "Any"
end
within ".assignee-filter" do
click_link "Any"
end
select2(nil, from: "#author_id")
select2(nil, from: "#assignee_id")
end
def should_see(issue)
......
class Spinach::Features::DashboardMergeRequests < Spinach::FeatureSteps
include SharedAuthentication
include SharedPaths
include Select2Helper
step 'I should see merge requests assigned to me' do
should_see(assigned_merge_request)
......@@ -39,21 +40,13 @@ class Spinach::Features::DashboardMergeRequests < Spinach::FeatureSteps
end
step 'I click "Authored by me" link' do
within ".assignee-filter" do
click_link "Any"
end
within ".author-filter" do
click_link current_user.name
end
select2(current_user.id, from: "#author_id")
select2(nil, from: "#assignee_id")
end
step 'I click "All" link' do
within ".author-filter" do
click_link "Any"
end
within ".assignee-filter" do
click_link "Any"
end
select2(nil, from: "#author_id")
select2(nil, from: "#assignee_id")
end
def should_see(merge_request)
......
......@@ -2,24 +2,7 @@ class Spinach::Features::ProjectIssuesFilterLabels < Spinach::FeatureSteps
include SharedAuthentication
include SharedProject
include SharedPaths
step 'I should see "bug" in labels filter' do
within ".labels-filter" do
page.should have_content "bug"
end
end
step 'I should see "feature" in labels filter' do
within ".labels-filter" do
page.should have_content "feature"
end
end
step 'I should see "enhancement" in labels filter' do
within ".labels-filter" do
page.should have_content "enhancement"
end
end
include Select2Helper
step 'I should see "Bugfix1" in issues list' do
within ".issues-list" do
......@@ -46,9 +29,7 @@ class Spinach::Features::ProjectIssuesFilterLabels < Spinach::FeatureSteps
end
step 'I click link "bug"' do
within ".labels-filter" do
click_link "bug"
end
select2('bug', from: "#label_name")
end
step 'I click link "feature"' do
......
......@@ -95,7 +95,7 @@ describe 'Issues', feature: true do
let(:issue) { @issue }
it 'should allow filtering by issues with no specified milestone' do
visit namespace_project_issues_path(project.namespace, project, milestone_id: '0')
visit namespace_project_issues_path(project.namespace, project, milestone_id: IssuableFinder::NONE)
expect(page).not_to have_content 'foobar'
expect(page).to have_content 'barbaz'
......@@ -111,7 +111,7 @@ describe 'Issues', feature: true do
end
it 'should allow filtering by issues with no specified assignee' do
visit namespace_project_issues_path(project.namespace, project, assignee_id: '0')
visit namespace_project_issues_path(project.namespace, project, assignee_id: IssuableFinder::NONE)
expect(page).to have_content 'foobar'
expect(page).not_to have_content 'barbaz'
......
......@@ -17,9 +17,9 @@ module Select2Helper
selector = options[:from]
if options[:multiple]
execute_script("$('#{selector}').select2('val', ['#{value}']);")
execute_script("$('#{selector}').select2('val', ['#{value}'], true);")
else
execute_script("$('#{selector}').select2('val', '#{value}');")
execute_script("$('#{selector}').select2('val', '#{value}', true);")
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment