Add specs for 1c80c233cf
This commit is contained in:
parent
1c80c233cf
commit
b6ce93a965
|
@ -3,6 +3,7 @@ require 'rails_helper'
|
||||||
RSpec.describe "Managing groups as an admin" do
|
RSpec.describe "Managing groups as an admin" do
|
||||||
let(:admin) { Fabricate(:admin) }
|
let(:admin) { Fabricate(:admin) }
|
||||||
let(:user) { Fabricate(:user) }
|
let(:user) { Fabricate(:user) }
|
||||||
|
let(:group) { Fabricate(:group) }
|
||||||
|
|
||||||
before do
|
before do
|
||||||
sign_in(admin)
|
sign_in(admin)
|
||||||
|
@ -26,4 +27,17 @@ RSpec.describe "Managing groups as an admin" do
|
||||||
expect(group.allow_membership_requests).to eq(true)
|
expect(group.allow_membership_requests).to eq(true)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe 'adding a new owner' do
|
||||||
|
it 'should work' do
|
||||||
|
put "/admin/groups/#{group.id}/owners.json", group: {
|
||||||
|
usernames: [user.username, admin.username].join(",")
|
||||||
|
}
|
||||||
|
|
||||||
|
expect(response).to be_success
|
||||||
|
|
||||||
|
expect(group.group_users.where(owner: true).map(&:user))
|
||||||
|
.to contain_exactly(user, admin)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue