Commit bfbbb182 authored by Long Nguyen's avatar Long Nguyen

Fix broken specs

parent a263425f
...@@ -3,7 +3,6 @@ class ProjectMember < Member ...@@ -3,7 +3,6 @@ class ProjectMember < Member
include Gitlab::ShellAdapter include Gitlab::ShellAdapter
has_many :todos, through: :user
belongs_to :project, class_name: 'Project', foreign_key: 'source_id' belongs_to :project, class_name: 'Project', foreign_key: 'source_id'
# Make sure project member points only to project as it source # Make sure project member points only to project as it source
...@@ -15,7 +14,7 @@ class ProjectMember < Member ...@@ -15,7 +14,7 @@ class ProjectMember < Member
scope :in_projects, ->(projects) { where(source_id: projects.pluck(:id)) } scope :in_projects, ->(projects) { where(source_id: projects.pluck(:id)) }
scope :with_user, ->(user) { where(user_id: user.id) } scope :with_user, ->(user) { where(user_id: user.id) }
before_destroy { todos.each(&:destroy) } before_destroy { user.todos.where(project_id: source_id).each(&:destroy) }
class << self class << self
......
...@@ -21,7 +21,6 @@ require 'spec_helper' ...@@ -21,7 +21,6 @@ require 'spec_helper'
describe ProjectMember, models: true do describe ProjectMember, models: true do
describe 'associations' do describe 'associations' do
it { is_expected.to have_many(:todos).through(:user) }
it { is_expected.to belong_to(:project).class_name('Project').with_foreign_key(:source_id) } it { is_expected.to belong_to(:project).class_name('Project').with_foreign_key(:source_id) }
end end
......
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