summaryrefslogtreecommitdiff
path: root/spec/models/group_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/group_spec.rb')
-rw-r--r--spec/models/group_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/models/group_spec.rb b/spec/models/group_spec.rb
index 12b84700eb1..686e43d8d10 100644
--- a/spec/models/group_spec.rb
+++ b/spec/models/group_spec.rb
@@ -54,4 +54,19 @@ describe Group do
group.users_groups.guests.map(&:user).should_not include(user)
end
end
+
+ describe :avatar_type do
+ let(:user) { create(:user) }
+ before { group.add_user(user, UsersGroup::MASTER) }
+
+ it "should be true if avatar is image" do
+ group.update_attribute(:avatar, 'uploads/avatar.png')
+ group.avatar_type.should be_true
+ end
+
+ it "should be false if avatar is html page" do
+ group.update_attribute(:avatar, 'uploads/avatar.html')
+ group.avatar_type.should == ["only images allowed"]
+ end
+ end
end