Sha256: 717d60997f38ef54f8221ec30355b976a21a69838c494df3360c4cdbf7a11209

Contents?: true

Size: 1.18 KB

Versions: 4

Compression:

Stored size: 1.18 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
		unless EpomRails.config.offline
			banner = banners(:one)	  	

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

	test 'delete an banner' do
		unless EpomRails.config.offline
			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
	end

	test 'epom methods' do
		unless EpomRails.config.offline
			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
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
epom_rails-0.4.9 test/epom_rails/acts_as_banner_test.rb
epom_rails-0.4.8 test/epom_rails/acts_as_banner_test.rb
epom_rails-0.4.7 test/epom_rails/acts_as_banner_test.rb
epom_rails-0.4.6 test/epom_rails/acts_as_banner_test.rb