Merge remote-tracking branch 'origin/dev' into timeline

pull/4927/head
Oliver Günther 8 years ago
commit 582cd616f1
No known key found for this signature in database
GPG Key ID: 88872239EB414F99
  1. 4
      app/models/query.rb
  2. 8
      spec/features/accessibility/work_packages/work_package_query_spec.rb
  3. 4
      spec/features/work_packages/export_spec.rb
  4. 8
      spec/features/work_packages/pagination_spec.rb
  5. 6
      spec/features/work_packages/select_work_package_row_spec.rb

@ -82,9 +82,9 @@ class Query < ActiveRecord::Base
sortable: "#{::Type.table_name}.position",
groupable: true),
QueryColumn.new(:parent,
sortable: ["#{WorkPackage.table_name}.root_id",
sortable: ["#{WorkPackage.table_name}.root_id ASC",
"#{WorkPackage.table_name}.lft ASC"],
default_order: 'desc'),
default_order: 'asc'),
QueryColumn.new(:status,
sortable: "#{Status.table_name}.position",
groupable: true),

@ -170,24 +170,20 @@ describe 'Work package index accessibility', type: :feature, selenium: true do
FactoryGirl.create(:work_package,
project: project)
}
let!(:yet_another_work_package) {
FactoryGirl.create(:work_package,
project: project)
}
before do
visit_index_page
end
context 'focus' do
let(:first_link_selector) do
"#wp-row-#{yet_another_work_package.id} td.id a"
"#wp-row-#{work_package.id} td.id a"
end
let(:second_link_selector) do
"#wp-row-#{another_work_package.id} td.id a"
end
it 'navigates with J and K' do
expect(page).to have_selector("#wp-row-#{yet_another_work_package.id}")
expect(page).to have_selector("#wp-row-#{work_package.id}")
expect(page).to have_selector("#wp-row-#{another_work_package.id}")
find('body').native.send_keys('j')

@ -87,8 +87,8 @@ describe 'work package export', type: :feature do
expect(subject).to have_text(wp_3.description)
expect(subject).to have_text(wp_4.description)
# results are ordered by ID (desc) and not grouped by type
expect(subject.scan(/Type (A|B)/).flatten).to eq %w(A B A A)
# results are ordered by ID (asc) and not grouped by type
expect(subject.scan(/Type (A|B)/).flatten).to eq %w(A A B A)
end
it 'shows all work packages grouped by ', js: true, retry: 2 do

@ -51,8 +51,8 @@ RSpec.feature 'Work package pagination', js: true do
expect(page).to have_content('Work packages')
within('#work-packages-index') do
expect(page).to_not have_content(work_package_1.subject)
expect(page).to have_content(work_package_2.subject)
expect(page).to have_content(work_package_1.subject)
expect(page).to_not have_content(work_package_2.subject)
end
within('.pagination--pages') do
@ -60,8 +60,8 @@ RSpec.feature 'Work package pagination', js: true do
end
within('#work-packages-index') do
expect(page).to have_content(work_package_1.subject)
expect(page).to_not have_content(work_package_2.subject)
expect(page).to have_content(work_package_2.subject)
expect(page).to_not have_content(work_package_1.subject)
end
within('.pagination--options') do

@ -203,7 +203,7 @@ describe 'Select work package row', type: :feature, js:true, selenium: true do
it do
expect(page).to have_selector('.work-packages--details--subject',
text: work_package_3.subject)
text: work_package_1.subject)
end
end
@ -216,11 +216,11 @@ describe 'Select work package row', type: :feature, js:true, selenium: true do
end
it do
wp_page = Pages::FullWorkPackage.new(work_package_3)
wp_page = Pages::FullWorkPackage.new(work_package_1)
subject_field = wp_page.edit_field :subject
subject_field.expect_active!
expect(subject_field.input_element.value).to eq(work_package_3.subject)
expect(subject_field.input_element.value).to eq(work_package_1.subject)
# Cancel edit
find('#work-packages--edit-actions-cancel').click

Loading…
Cancel
Save