From ef7dfc4522d2945063d0bb9aa03fd8203077d796 Mon Sep 17 00:00:00 2001 From: Francisco Marcelo de Araújo Lima Júnior Date: Thu, 27 Feb 2014 14:48:07 -0300 Subject: [PATCH] add unit testes to embed block support --- app/models/block.rb | 4 ++-- test/unit/block_test.rb | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/app/models/block.rb b/app/models/block.rb index c30537d..d2fd8bf 100644 --- a/app/models/block.rb +++ b/app/models/block.rb @@ -16,12 +16,12 @@ class Block < ActiveRecord::Base named_scope :enabled, :conditions => { :enabled => true } - def embedable + def embedable? true end def embed_code(url) - html = "" + html = "" end # Determines whether a given block must be visible. Optionally a diff --git a/test/unit/block_test.rb b/test/unit/block_test.rb index e7d6957..6281b4e 100644 --- a/test/unit/block_test.rb +++ b/test/unit/block_test.rb @@ -222,4 +222,14 @@ class BlockTest < ActiveSupport::TestCase assert block.visible?(2) assert !block.visible?(3) end + + should 'be embedable by default' do + assert Block.new.embedable? + end + + should 'generate embed url' do + b = Block.new + assert_equal "", b.embed_code('http://myblogtest.com') + end + end -- libgit2 0.21.2