Fix specs after removing assignee_id field

This commit is contained in:
Valery Sizov 2017-05-24 13:25:12 +03:00 committed by Sean McGivern
parent b1aa91fbac
commit 43442be4e5
3 changed files with 4 additions and 2 deletions

View File

@ -32,5 +32,7 @@ class RemoveAssigneeIdFromIssue < ActiveRecord::Migration
def down
add_column :issues, :assignee_id, :integer
add_concurrent_index :issues, :assignee_id
execute('UPDATE issues SET assignee_id = (SELECT user_id FROM issue_assignees WHERE issue_assignees.issue_id = issues.id LIMIT 1)')
end
end

View File

@ -138,7 +138,7 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
private
def assigned_to_me(key)
project.send(key).where(assignee_id: current_user.id)
project.send(key).assigned_to(current_user)
end
def project

View File

@ -45,7 +45,7 @@ describe Members::AuthorizedDestroyService do
expect { described_class.new(member, member_user).execute }
.to change { number_of_assigned_issuables(member_user) }.from(4).to(2)
expect(issue.reload.assignee_id).to be_nil
expect(issue.reload.assignee_ids).to be_empty
expect(merge_request.reload.assignee_id).to be_nil
end
end