Commit e13a1aa9 authored by charlieablett's avatar charlieablett

Fix tests and add migration

- Change "none" weight board filter to "any" which is what it was
previously doing (so should have minimal user impact)
- Fix those integration tests
parent 52f8ae1e
# frozen_string_literal: true
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
class DefaultWeightMilestoneToNil < ActiveRecord::Migration[5.1]
include Gitlab::Database::MigrationHelpers
# Set this constant to true if this migration requires downtime.
DOWNTIME = false
# When a migration requires downtime you **must** uncomment the following
# constant and define a short and easy to understand explanation as to why the
# migration requires downtime.
# DOWNTIME_REASON = ''
# When using the methods "add_concurrent_index", "remove_concurrent_index" or
# "add_column_with_default" you must disable the use of transactions
# as these methods can not run in an existing transaction.
# When using "add_concurrent_index" or "remove_concurrent_index" methods make sure
# that either of them is the _only_ method called in the migration,
# any other changes should go in a separate migration.
# This ensures that upon failure _only_ the index creation or removing fails
# and can be retried or reverted easily.
#
# To disable transactions uncomment the following line and remove these
# comments:
# disable_ddl_transaction!
def change
update_board_weights_from_none_to_any
update_board_milestone_from_none_to_any
end
def update_board_weights_from_none_to_any
execute("UPDATE boards SET weight = null WHERE weight = -1")
end
def update_board_milestone_from_none_to_any
execute("UPDATE boards SET milestone_id = null WHERE milestone_id = -1")
end
end
......@@ -171,13 +171,13 @@ describe 'Scoped issue boards', :js do
it 'creates board filtering by "Any" weight' do
create_board_weight('Any')
expect(page).to have_selector('.board-card', count: 4)
expect(page).to have_selector('.board-card', count: 5)
end
it 'creates board filtering by "None" weight' do
create_board_weight('None')
expect(page).to have_selector('.board-card', count: 5)
expect(page).to have_selector('.board-card', count: 4)
end
it 'displays dot highlight and tooltip' do
......
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