Sha256: 5ae766a59a0c59072b7c9cc914e061c1db5fc6c92f382e57b934c4e45e3c60a9
Contents?: true
Size: 1.81 KB
Versions: 2
Compression:
Stored size: 1.81 KB
Contents
require 'test_helper' class GravatarifyArDmTest < Test::Unit::TestCase def setup; reset_gravatarify! end context "ActiveRecord::Base" do if defined?(ActiveRecord) should "include Gravatarify::ObjectSupport" do assert ActiveRecord::Base.included_modules.include?(Gravatarify::ObjectSupport) end should "respond to #gravatarify" do assert_respond_to ActiveRecord::Base, :gravatarify end else context "tests" do should "be run (but looks like ActiveRecord is not available)" do flunk "ActiveRecord not available -> thus tests are incomplete (error can be ignored though!)" end end end end context "DataMapper model (User)" do if defined?(DataMapper) setup do class User include DataMapper::Resource property :id, Serial property :name, String property :email, String property :author_email, String gravatarify end end should "include Gravatarify::ObjectSupport" do assert User.included_modules.include?(Gravatarify::ObjectSupport) end should "respond to #gravatarify" do assert_respond_to User, :gravatarify end context "as instance" do should "be able to build correct gravatar_url's!" do u = User.new(:email => "peter.gibbons@initech.com") assert_equal "http://0.gravatar.com/avatar/cb7865556d41a3d800ae7dbb31d51d54.jpg", u.gravatar_url end end else context "tests" do should "be run (but looks like DataMapper is not available)" do flunk "DataMapper not available -> thus tests are incomplete (error can be ignored though!)" end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
gravatarify-1.2.1 | test/unit/gravatarify_ar_dm_test.rb |
gravatarify-1.2.0 | test/unit/gravatarify_ar_dm_test.rb |