Skip to content
Snippets Groups Projects
Commit 93a20ea8 authored by Regis's avatar Regis
Browse files

fix tasks list spec in rspec

parent b29f91b0
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -16,6 +16,10 @@
- if issue.assignee
%li
= link_to_member(@project, issue.assignee, name: false, title: "Assigned to :name")
- if issue.tasks?
 
%span.task-status
= issue.task_status
 
= render 'shared/issuable_meta_data', issuable: issue
 
Loading
Loading
@@ -37,6 +41,10 @@
 
- issue.labels.each do |label|
= link_to_label(label, subject: issue.project, css_class: 'label-link')
- if issue.tasks?
 
%span.task-status
= issue.task_status
 
.pull-right.issue-updated-at
%span updated #{time_ago_with_tooltip(issue.updated_at, placement: 'bottom', html_class: 'issue_update_ago')}
Loading
Loading
@@ -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)
Loading
Loading
@@ -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
Loading
Loading
@@ -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)
Loading
Loading
@@ -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)
Loading
Loading
@@ -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
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment