Sha256: c51fa9f88ea1706e7b898abe9c40fbfc0d2aa25811d4f0af1db49eebc92cf757
Contents?: true
Size: 997 Bytes
Versions: 4
Compression:
Stored size: 997 Bytes
Contents
require 'spec_helper' describe Lessonly::Group do describe '#all' do it 'should return all groups' do groups = Lessonly::Group.all expect(groups.count).to eq 1 end end describe '#find' do it 'should find a single group' do group = Lessonly::Group.find(1) expect(group.name).to eq 'Developers' end end describe '#create_membership' do it 'should add a user to the group\'s members' do group = Lessonly::Group.find(1) user = Lessonly::User.find(3) group.create_membership(user) expect(group.members.map(&:name)).to include(user.name) expect(group.members.count).to eq(3) end end describe '#destroy_membership' do it 'should remove a user from the group\'s members' do group = Lessonly::Group.find(1) user = Lessonly::User.find(1) group.destroy_membership(user) member = group.members.find { |m| m.id == user.id } expect(member.remove).to eq(true) end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
lessonly-ruby-0.1.3 | spec/group_spec.rb |
lessonly-ruby-0.1.2 | spec/group_spec.rb |
lessonly-ruby-0.1.1 | spec/group_spec.rb |
lessonly-ruby-0.1.0 | spec/group_spec.rb |