Commit 62f1c977 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Add User#avatar_type tests

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent e6f83399
......@@ -279,4 +279,18 @@ describe User do
User.by_username_or_id('bar').should be_nil
end
end
describe :avatar_type do
let(:user) { create(:user) }
it "should be true if avatar is image" do
user.update_attribute(:avatar, 'uploads/avatar.png')
user.avatar_type.should be_true
end
it "should be false if avatar is html page" do
user.update_attribute(:avatar, 'uploads/avatar.html')
user.avatar_type.should == ["only images allowed"]
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment