Sha256: e333f1aeead757b9c2156af26b73c40321229056daad87f32d9734568d659283

Contents?: true

Size: 1.06 KB

Versions: 4

Compression:

Stored size: 1.06 KB

Contents

require 'test_helper'

class ActsAsBannerTest < ActiveSupport::TestCase
	def epom_field(field)
		Banner.epom_fields.key(field)
	end

	test 'fancy_method' do
	  	assert_raises NoMethodError do Banner.fancy_method end
	end

	test 'save an banner' do
		banner = banners(:one)	  	

	  	assert	banner.save
	  	assert_instance_of Fixnum, banner.send(epom_field('id'))
	end

	test 'delete an banner' do
		banner = banners(:one)	  	

	  	assert	banner.save
	  	assert_instance_of Fixnum, banner.send(epom_field('id'))

	  	epom_id = banner.send(epom_field('id'))
	  	assert banner.destroy
	end

	test 'epom methods' do
		banner = banners(:one)	  	

	  	assert	banner.save
	  	assert_instance_of Fixnum, banner.send(epom_field('id'))

		response = Banner.get_banner({:bannerId => banner.send(epom_field('id'))}, {})
		assert_equal banner.campaign_id, response['campaignId']
		assert_equal banner.weight, response['weight']
		assert_equal banner.url, response['url']
		assert_equal banner.name, response['name']
		assert_equal banner.image_banner_link, response['imageBannerLink']		
	end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
epom_rails-0.4.5 test/epom_rails/acts_as_banner_test.rb
epom_rails-0.4.2 test/epom_rails/acts_as_banner_test.rb
epom_rails-0.4.1 test/epom_rails/acts_as_banner_test.rb
epom_rails-0.3 test/epom_rails/acts_as_banner_test.rb