mirror of
https://github.com/manyfold3d/manyfold.git
synced 2026-10-21 19:22:18 -05:00
29 lines
702 B
Ruby
29 lines
702 B
Ruby
require "rails_helper"
|
|
|
|
RSpec.describe Group do
|
|
it_behaves_like "Caber::Subject"
|
|
|
|
it "must be owned by a creator" do
|
|
group = build(:group, creator: nil)
|
|
expect(group).not_to be_valid
|
|
end
|
|
|
|
it "is in the owning creator's list of groups" do
|
|
alice = create(:creator)
|
|
group = create(:group, creator: alice)
|
|
expect(alice.groups).to include(group)
|
|
end
|
|
|
|
it "has members (which are users)" do
|
|
alice = create(:user)
|
|
group = create(:group)
|
|
group.members << alice
|
|
expect(group.members).to include alice
|
|
end
|
|
|
|
it "can have a description" do
|
|
group = create(:group, description: "details go here")
|
|
expect(group.description).to eq "details go here"
|
|
end
|
|
end
|