From 251df827a5308d483a95242970569075ab655703 Mon Sep 17 00:00:00 2001 From: Steven Thonus Date: Mon, 27 Jan 2014 22:34:05 +0100 Subject: added group avatars --- spec/models/group_spec.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'spec/models/group_spec.rb') 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 -- cgit v1.2.1