Commit 4f1bb91a authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fix finder and tests for new membership models

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 6558e52d
...@@ -32,7 +32,7 @@ class ProjectsFinder ...@@ -32,7 +32,7 @@ class ProjectsFinder
# #
group.projects.where( group.projects.where(
"projects.id IN (?) OR projects.visibility_level IN (?)", "projects.id IN (?) OR projects.visibility_level IN (?)",
projects_members.pluck(:project_id), projects_members.pluck(:source_id),
Project.public_and_internal_levels Project.public_and_internal_levels
) )
else else
......
...@@ -40,7 +40,7 @@ class AdminGroups < Spinach::FeatureSteps ...@@ -40,7 +40,7 @@ class AdminGroups < Spinach::FeatureSteps
user = User.find_by(name: "John Doe") user = User.find_by(name: "John Doe")
select2(user.id, from: "#user_ids", multiple: true) select2(user.id, from: "#user_ids", multiple: true)
within "#new_team_member" do within "#new_team_member" do
select "Reporter", from: "group_access" select "Reporter", from: "access_level"
end end
click_button "Add users into group" click_button "Add users into group"
end end
......
...@@ -32,7 +32,7 @@ class Groups < Spinach::FeatureSteps ...@@ -32,7 +32,7 @@ class Groups < Spinach::FeatureSteps
click_link 'Add members' click_link 'Add members'
within ".users-group-form" do within ".users-group-form" do
select2(user.id, from: "#user_ids", multiple: true) select2(user.id, from: "#user_ids", multiple: true)
select "Reporter", from: "group_access" select "Reporter", from: "access_level"
end end
click_button "Add users into group" click_button "Add users into group"
end end
......
...@@ -23,7 +23,7 @@ class ProjectTeamManagement < Spinach::FeatureSteps ...@@ -23,7 +23,7 @@ class ProjectTeamManagement < Spinach::FeatureSteps
user = User.find_by(name: "Mike") user = User.find_by(name: "Mike")
select2(user.id, from: "#user_ids", multiple: true) select2(user.id, from: "#user_ids", multiple: true)
within "#new_team_member" do within "#new_project_member" do
select "Reporter", from: "access_level" select "Reporter", from: "access_level"
end end
click_button "Add users" click_button "Add users"
......
...@@ -68,7 +68,7 @@ module API ...@@ -68,7 +68,7 @@ module API
class GroupMember < UserBasic class GroupMember < UserBasic
expose :access_level do |user, options| 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
end end
......
...@@ -506,7 +506,7 @@ describe Notify do ...@@ -506,7 +506,7 @@ describe Notify do
describe 'group access changed' do describe 'group access changed' do
let(:group) { create(:group) } let(:group) { create(:group) }
let(:user) { create(:user) } 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) } subject { Notify.group_access_granted_email(membership.id) }
......
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