This project is archived and is in readonly mode.
Unfunctional ActionView::TestCase
-
papricek
require File.dirname(FILE) + '/../../testhelper' require 'admin/advertisementshelper'
class Admin::AdvertisementsHelperTest < ActionView::TestCase
include Admin::AdvertisementsHelper fixtures :advertisements, :advertisers, :advertisementassignments, :advertisementpositions
def testrenderadvertisement_one
position = advertisement_positions(:one) a = advertisements(:one) html = render_advertisements(position.slug, 1) assert_match /#{a.id}/, html, "HTML reklamy obsahuje id reklamy" assert_match /skyscraper/, html, "Div reklamy obsahuje spravny class"end end
-
papricek
require File.dirname(FILE) + '/../../testhelper' require 'admin/advertisementshelper'
class Admin::AdvertisementsHelperTest < ActionView::TestCase
include Admin::AdvertisementsHelper fixtures :advertisements, :advertisers, :advertisementassignments, :advertisementpositions
def testrenderadvertisement_one
position = advertisement_positions(:one) a = advertisements(:one) html = render_advertisements(position.slug, 1) assert_match /#{a.id}/, html, "HTML reklamy obsahuje id reklamy" assert_match /skyscraper/, html, "Div reklamy obsahuje spravny class"end end
module Admin::AdvertisementsHelper
def render_advertisements(type, count)
ads = Advertisement.find_for_position(type, count) html = "" ads.each do |ad| if ad.script.empty? html << case ad.ad_type when "Fullbanner" render_fullbanner(ad) when "Skyscraper" render_skyscraper(ad) when "Text" render_text_ad(ad) when "Flash" render_flash(ad) when "Halfbanner" render_halfbanner(ad) end else html << ad.script end end return htmlend etc... end
-
josh
- State changed from new to stale