diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-09-15 17:45:28 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-09-15 17:45:28 +0400 |
commit | 4f1bb91a75111188ce52e8fde1c3ac0acfff452e (patch) | |
tree | b0b640969c2f6d71511122886503e62982c318d3 | |
parent | 6558e52d904daa9f710192e838fdb7872b1682e2 (diff) |
Fix finder and tests for new membership models
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
-rw-r--r-- | app/finders/projects_finder.rb | 2 | ||||
-rw-r--r-- | features/steps/admin/groups.rb | 2 | ||||
-rw-r--r-- | features/steps/group/group.rb | 2 | ||||
-rw-r--r-- | features/steps/project/team_management.rb | 2 | ||||
-rw-r--r-- | lib/api/entities.rb | 2 | ||||
-rw-r--r-- | spec/mailers/notify_spec.rb | 2 |
6 files changed, 6 insertions, 6 deletions
diff --git a/app/finders/projects_finder.rb b/app/finders/projects_finder.rb index 222496cd317..c81bb51583a 100644 --- a/app/finders/projects_finder.rb +++ b/app/finders/projects_finder.rb @@ -32,7 +32,7 @@ class ProjectsFinder # group.projects.where( "projects.id IN (?) OR projects.visibility_level IN (?)", - projects_members.pluck(:project_id), + projects_members.pluck(:source_id), Project.public_and_internal_levels ) else diff --git a/features/steps/admin/groups.rb b/features/steps/admin/groups.rb index 9c1bcfefb9c..d761584ad93 100644 --- a/features/steps/admin/groups.rb +++ b/features/steps/admin/groups.rb @@ -40,7 +40,7 @@ class AdminGroups < Spinach::FeatureSteps user = User.find_by(name: "John Doe") select2(user.id, from: "#user_ids", multiple: true) within "#new_team_member" do - select "Reporter", from: "group_access" + select "Reporter", from: "access_level" end click_button "Add users into group" end diff --git a/features/steps/group/group.rb b/features/steps/group/group.rb index c3ee42f1127..d0ec503f47b 100644 --- a/features/steps/group/group.rb +++ b/features/steps/group/group.rb @@ -32,7 +32,7 @@ class Groups < Spinach::FeatureSteps click_link 'Add members' within ".users-group-form" do select2(user.id, from: "#user_ids", multiple: true) - select "Reporter", from: "group_access" + select "Reporter", from: "access_level" end click_button "Add users into group" end diff --git a/features/steps/project/team_management.rb b/features/steps/project/team_management.rb index db04e234c84..76a0671721e 100644 --- a/features/steps/project/team_management.rb +++ b/features/steps/project/team_management.rb @@ -23,7 +23,7 @@ class ProjectTeamManagement < Spinach::FeatureSteps user = User.find_by(name: "Mike") select2(user.id, from: "#user_ids", multiple: true) - within "#new_team_member" do + within "#new_project_member" do select "Reporter", from: "access_level" end click_button "Add users" diff --git a/lib/api/entities.rb b/lib/api/entities.rb index 4b14472fd5c..ffa3e8a149e 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -68,7 +68,7 @@ module API class GroupMember < UserBasic expose :access_level do |user, options| - options[:group].group_members.find_by(user_id: user.id).group_access + options[:group].group_members.find_by(user_id: user.id).access_level end end diff --git a/spec/mailers/notify_spec.rb b/spec/mailers/notify_spec.rb index 4b64cefa852..799dce442cc 100644 --- a/spec/mailers/notify_spec.rb +++ b/spec/mailers/notify_spec.rb @@ -506,7 +506,7 @@ describe Notify do describe 'group access changed' do let(:group) { create(:group) } let(:user) { create(:user) } - let(:membership) { create(:users_group, group: group, user: user) } + let(:membership) { create(:group_member, group: group, user: user) } subject { Notify.group_access_granted_email(membership.id) } |