Improve features to ensure Ajax filter has actually executed

This commit is contained in:
Stan Hu 2015-07-08 08:28:37 -07:00 committed by Robert Speicher
parent 098ad0a5b4
commit 098ced4faa
2 changed files with 10 additions and 6 deletions

View file

@ -3,9 +3,12 @@ require 'rails_helper'
feature 'Issue filtering by Milestone', feature: true do
include Select2Helper
let(:project) { create(:project, :public) }
let(:milestone) { create(:milestone, project: project) }
scenario 'filters by no Milestone', js: true do
project = create(:project, :public)
create(:issue, project: project)
create(:issue, project: project, milestone: milestone)
visit_issues(project)
filter_by_milestone(Milestone::None.title)
@ -14,9 +17,8 @@ feature 'Issue filtering by Milestone', feature: true do
end
scenario 'filters by a specific Milestone', js: true do
project = create(:project, :public)
milestone = create(:milestone, project: project)
create(:issue, project: project, milestone: milestone)
create(:issue, project: project)
visit_issues(project)
filter_by_milestone(milestone.title)

View file

@ -3,9 +3,12 @@ require 'rails_helper'
feature 'Merge Request filtering by Milestone', feature: true do
include Select2Helper
let(:project) { create(:project, :public) }
let(:milestone) { create(:milestone, project: project) }
scenario 'filters by no Milestone', js: true do
project = create(:project, :public)
create(:merge_request, :with_diffs, source_project: project)
create(:merge_request, :simple, source_project: project, milestone: milestone)
visit_merge_requests(project)
filter_by_milestone(Milestone::None.title)
@ -14,9 +17,8 @@ feature 'Merge Request filtering by Milestone', feature: true do
end
scenario 'filters by a specific Milestone', js: true do
project = create(:project, :public)
milestone = create(:milestone, project: project)
create(:merge_request, :with_diffs, source_project: project, milestone: milestone)
create(:merge_request, :simple, source_project: project)
visit_merge_requests(project)
filter_by_milestone(milestone.title)