Commit b9fa82da authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Update tests and use js-issuable class for context form

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent a9095280
...@@ -25,5 +25,5 @@ class @Issue ...@@ -25,5 +25,5 @@ class @Issue
$.ajax $.ajax
type: 'PATCH' type: 'PATCH'
url: $('form.js-issue-update').attr('action') url: $('form.js-issuable-update').attr('action')
data: patchData data: patchData
...@@ -49,5 +49,5 @@ class @MergeRequest ...@@ -49,5 +49,5 @@ class @MergeRequest
$.ajax $.ajax
type: 'PATCH' type: 'PATCH'
url: $('form.js-merge-request-update').attr('action') url: $('form.js-issuable-update').attr('action')
data: patchData data: patchData
%li{ id: dom_id(issue), class: issue_css_classes(issue), url: issue_path(issue) } %li{ id: dom_id(issue), class: issue_css_classes(issue), url: issue_path(issue) }
- if controller.controller_name == 'issues' - if controller.controller_name == 'issues'
.issue-check .issue-check
= check_box_tag dom_id(issue,"selected"), nil, false, 'data-id' => issue.id, class: "selected_issue", disabled: !can?(current_user, :modify_issue, issue) = check_box_tag dom_id(issue,"selected"), nil, false, 'data-id' => issue.id, class: "selected_issue", disabled: !can?(current_user, :set_assignee, issue)
.issue-title .issue-title
%span.issue-title-text %span.issue-title-text
......
= form_for [@project.namespace.becomes(Namespace), @project, issuable], remote: true, html: {class: 'issuable-context-form inline-update js-merge-request-update'} do |f| = form_for [@project.namespace.becomes(Namespace), @project, issuable], remote: true, html: {class: 'issuable-context-form inline-update js-issuable-update'} do |f|
%div.prepend-top-20 %div.prepend-top-20
.issuable-context-title .issuable-context-title
%label %label
......
...@@ -218,7 +218,7 @@ describe 'Issues', feature: true do ...@@ -218,7 +218,7 @@ describe 'Issues', feature: true do
it 'with dropdown menu' do it 'with dropdown menu' do
visit namespace_project_issue_path(project.namespace, project, issue) visit namespace_project_issue_path(project.namespace, project, issue)
find('.edit-issue.inline-update #issue_assignee_id'). find('.context #issue_assignee_id').
set project.team.members.first.id set project.team.members.first.id
click_button 'Update Issue' click_button 'Update Issue'
...@@ -257,7 +257,7 @@ describe 'Issues', feature: true do ...@@ -257,7 +257,7 @@ describe 'Issues', feature: true do
it 'with dropdown menu' do it 'with dropdown menu' do
visit namespace_project_issue_path(project.namespace, project, issue) visit namespace_project_issue_path(project.namespace, project, issue)
find('.edit-issue.inline-update'). find('.context').
select(milestone.title, from: 'issue_milestone_id') select(milestone.title, from: 'issue_milestone_id')
click_button 'Update Issue' click_button 'Update Issue'
......
require 'spec_helper' require 'spec_helper'
feature 'Task Lists' do feature 'Task Lists', feature: true do
include Warden::Test::Helpers include Warden::Test::Helpers
let(:project) { create(:project) } let(:project) { create(:project) }
...@@ -52,7 +52,7 @@ feature 'Task Lists' do ...@@ -52,7 +52,7 @@ feature 'Task Lists' do
expect(page).to have_selector(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} .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("#{container} .js-task-list-field")
expect(page).to have_selector('form.js-issue-update') expect(page).to have_selector('form.js-issuable-update')
expect(page).to have_selector('a.btn-close') expect(page).to have_selector('a.btn-close')
end end
...@@ -128,7 +128,7 @@ feature 'Task Lists' do ...@@ -128,7 +128,7 @@ feature 'Task Lists' do
expect(page).to have_selector(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} .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("#{container} .js-task-list-field")
expect(page).to have_selector('form.js-merge-request-update') expect(page).to have_selector('form.js-issuable-update')
expect(page).to have_selector('a.btn-close') expect(page).to have_selector('a.btn-close')
end end
......
...@@ -10,4 +10,4 @@ ...@@ -10,4 +10,4 @@
%textarea.js-task-list-field %textarea.js-task-list-field
\- [ ] Task List Item \- [ ] Task List Item
%form.js-issue-update{action: '/foo'} %form.js-issuable-update{action: '/foo'}
...@@ -10,4 +10,4 @@ ...@@ -10,4 +10,4 @@
%textarea.js-task-list-field %textarea.js-task-list-field
\- [ ] Task List Item \- [ ] Task List Item
%form.js-merge-request-update{action: '/foo'} %form.js-issuable-update{action: '/foo'}
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