From 1f1b0f278be73091763b9133db6660b504f63fac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?U=C4=A3is=20Ozols?= Date: Tue, 31 Jul 2012 08:31:12 +0300 Subject: Move avatar_url method to posts helper because view stuff shouldn't be in the model. --- spec/helpers/refinery/blog/posts_helper_spec.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'spec') diff --git a/spec/helpers/refinery/blog/posts_helper_spec.rb b/spec/helpers/refinery/blog/posts_helper_spec.rb index b8c8911..7087bff 100644 --- a/spec/helpers/refinery/blog/posts_helper_spec.rb +++ b/spec/helpers/refinery/blog/posts_helper_spec.rb @@ -66,6 +66,18 @@ module Refinery end end end + + describe "#avatar_url" do + let(:email) { "test@test.com" } + + it "returns gravatar url" do + helper.avatar_url(email).should eq("http://gravatar.com/avatar/b642b4217b34b1e8d3bd915fc65c4452?s=60.jpg") + end + + it "accepts options hash to change default size" do + helper.avatar_url(email, :size => 55).should eq("http://gravatar.com/avatar/b642b4217b34b1e8d3bd915fc65c4452?s=55.jpg") + end + end end end end -- cgit v1.2.3