Commit 92f68276 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Fix tests and unassigned filter for issues. Updated CHANGELOG

parent d920f34af14d
......@@ -43,6 +43,9 @@
- 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,7 +10,8 @@
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
......@@ -13,7 +14,8 @@
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,7 +10,8 @@
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
......@@ -13,7 +14,8 @@
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 @@
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,12 +36,8 @@
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
......@@ -44,12 +41,8 @@
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,12 +40,8 @@
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
......@@ -48,12 +45,8 @@
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 @@
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 @@
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 @@
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 @@
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,5 +17,5 @@
selector = options[:from]
if options[:multiple]
execute_script("$('#{selector}').select2('val', ['#{value}']);")
execute_script("$('#{selector}').select2('val', ['#{value}'], true);")
else
......@@ -21,5 +21,5 @@
else
execute_script("$('#{selector}').select2('val', '#{value}');")
execute_script("$('#{selector}').select2('val', '#{value}', true);")
end
end
end
Supports Markdown
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