diff options
author | Regis <boudinot.regis@yahoo.com> | 2017-05-01 20:56:04 -0600 |
---|---|---|
committer | Regis <boudinot.regis@yahoo.com> | 2017-05-01 20:56:04 -0600 |
commit | cfc03dab245843b924c353e50e15e2e59733048e (patch) | |
tree | 48b849c17471407747a84f75d818d3d2b8fea5b9 | |
parent | 7021e867e41f86343fa8fe9cef75f89d466b2ef6 (diff) | |
download | gitlab-ce-cfc03dab245843b924c353e50e15e2e59733048e.tar.gz |
fix rubocop offenses
-rw-r--r-- | app/assets/javascripts/issue_show/issue_title_description.vue | 3 | ||||
-rw-r--r-- | spec/features/task_lists_spec.rb | 23 |
2 files changed, 9 insertions, 17 deletions
diff --git a/app/assets/javascripts/issue_show/issue_title_description.vue b/app/assets/javascripts/issue_show/issue_title_description.vue index 48b649cd565..7862923c004 100644 --- a/app/assets/javascripts/issue_show/issue_title_description.vue +++ b/app/assets/javascripts/issue_show/issue_title_description.vue @@ -43,7 +43,6 @@ export default { methods: { renderResponse(res) { this.apiData = JSON.parse(res.body); - this.issueIID = this.apiData.issue_number; this.triggerAnimation(); }, updateTaskHTML() { @@ -90,7 +89,7 @@ export default { setTabTitle() { const currentTabTitle = document.querySelector('title'); const currentTabTitleScope = currentTabTitle.innerText.split('·'); - currentTabTitleScope[0] = `${this.titleText} (#${this.issueIID}) `; + currentTabTitleScope[0] = `${this.titleText} (#${this.apiData.issue_number}) `; currentTabTitle.innerText = currentTabTitleScope.join('·'); }, animate(title, description, elementsToVisualize) { diff --git a/spec/features/task_lists_spec.rb b/spec/features/task_lists_spec.rb index 3858f4d8959..38437b4250a 100644 --- a/spec/features/task_lists_spec.rb +++ b/spec/features/task_lists_spec.rb @@ -62,15 +62,16 @@ feature 'Task Lists', feature: true do visit namespace_project_issue_path(project.namespace, project, issue) end - describe 'for Issues' do + describe 'for Issues', js: true do include WaitForVueResource + before { wait_for_vue_resource } + describe 'multiple tasks', js: true do 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) @@ -79,7 +80,6 @@ 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' @@ -92,14 +92,12 @@ feature 'Task Lists', feature: true do it 'is only editable by author' do visit_issue(project, issue) - wait_for_vue_resource expect(page).to have_selector('.js-task-list-container') logout(:user) login_as(user2) visit current_path - wait_for_vue_resource expect(page).not_to have_selector('.js-task-list-container') end @@ -109,12 +107,15 @@ feature 'Task Lists', feature: true do end end - describe 'single incomplete task' do + describe 'single incomplete task', js: true do + include WaitForVueResource + 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) @@ -132,7 +133,6 @@ feature 'Task Lists', feature: true do 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) @@ -151,9 +151,6 @@ feature 'Task Lists', feature: true do before { visit_issue(project, issue) } it 'renders' do - - wait_for_vue_resource - expect(page).to have_selector('ul.task-list', count: 2) expect(page).to have_selector('li.task-list-item', count: 7) expect(page).to have_selector('ul input[checked]', count: 1) @@ -163,8 +160,6 @@ feature 'Task Lists', feature: true do it 'solves tasks' do expect(page).to have_content("2 of 7 tasks completed") - wait_for_vue_resource - page.find('li.task-list-item', text: 'Task b').find('input').click page.find('li.task-list-item ul li.task-list-item', text: 'Task a.2').find('input').click page.find('li.task-list-item ol li.task-list-item', text: 'Task 1.1').find('input').click @@ -173,8 +168,6 @@ feature 'Task Lists', feature: true do visit_issue(project, issue) # reload to see new system notes - wait_for_vue_resource - expect(page).to have_content('marked the task Task b as complete') expect(page).to have_content('marked the task Task a.2 as complete') expect(page).to have_content('marked the task Task 1.1 as complete') |