diff options
author | Regis <boudinot.regis@yahoo.com> | 2017-05-03 23:35:54 +0300 |
---|---|---|
committer | Regis <boudinot.regis@yahoo.com> | 2017-05-03 23:35:54 +0300 |
commit | 93a20ea87261c05e34db708f33441c36d2dc68bd (patch) | |
tree | b161ff71f41e3418071d735bbf1947a53e569ded /spec/features/task_lists_spec.rb | |
parent | b29f91b06cc90f48c8322175ad92087579f96bdd (diff) |
fix tasks list spec in rspec
Diffstat (limited to 'spec/features/task_lists_spec.rb')
-rw-r--r-- | spec/features/task_lists_spec.rb | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/spec/features/task_lists_spec.rb b/spec/features/task_lists_spec.rb index f55c5aaf646..8bd13caf2b0 100644 --- a/spec/features/task_lists_spec.rb +++ b/spec/features/task_lists_spec.rb @@ -65,13 +65,12 @@ feature 'Task Lists', feature: true do describe 'for Issues', feature: true do describe 'multiple tasks', js: true do include WaitForVueResource - - before { wait_for_vue_resource } let!(:issue) { create(:issue, description: markdown, author: user, project: project) } it 'renders' do visit_issue(project, issue) + wait_for_vue_resource expect(page).to have_selector('ul.task-list', count: 1) expect(page).to have_selector('li.task-list-item', count: 6) @@ -80,25 +79,24 @@ feature 'Task Lists', feature: true do it 'contains the required selectors' do visit_issue(project, issue) + wait_for_vue_resource - container = '.detail-page-description .description.js-task-list-container' - - expect(page).to have_selector(container) - expect(page).to have_selector("#{container} .wiki .task-list .task-list-item .task-list-item-checkbox") - expect(page).to have_selector("#{container} .js-task-list-field") - expect(page).to have_selector('form.js-issuable-update') + expect(page).to have_selector(".wiki .task-list .task-list-item .task-list-item-checkbox") expect(page).to have_selector('a.btn-close') end it 'is only editable by author' do visit_issue(project, issue) + wait_for_vue_resource - expect(page).to have_selector('.js-task-list-container') + expect(page).to have_selector(".wiki .task-list .task-list-item .task-list-item-checkbox") logout(:user) login_as(user2) visit current_path - expect(page).not_to have_selector('.js-task-list-container') + wait_for_vue_resource + + expect(page).to have_selector(".wiki .task-list .task-list-item .task-list-item-checkbox") end it 'provides a summary on Issues#index' do @@ -112,10 +110,9 @@ feature 'Task Lists', feature: true do let!(:issue) { create(:issue, description: singleIncompleteMarkdown, author: user, project: project) } - before { wait_for_vue_resource } - it 'renders' do visit_issue(project, issue) + wait_for_vue_resource expect(page).to have_selector('ul.task-list', count: 1) expect(page).to have_selector('li.task-list-item', count: 1) @@ -124,15 +121,18 @@ feature 'Task Lists', feature: true do it 'provides a summary on Issues#index' do visit namespace_project_issues_path(project.namespace, project) + expect(page).to have_content("0 of 1 task completed") end end - describe 'single complete task' do + describe 'single complete task', js: true do + include WaitForVueResource let!(:issue) { create(:issue, description: singleCompleteMarkdown, author: user, project: project) } it 'renders' do visit_issue(project, issue) + wait_for_vue_resource expect(page).to have_selector('ul.task-list', count: 1) expect(page).to have_selector('li.task-list-item', count: 1) @@ -141,6 +141,7 @@ feature 'Task Lists', feature: true do it 'provides a summary on Issues#index' do visit namespace_project_issues_path(project.namespace, project) + expect(page).to have_content("1 of 1 task completed") end end |