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