touchlocal-openx 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/test/test_zone.rb ADDED
@@ -0,0 +1,100 @@
1
+ require 'helper'
2
+
3
+ class ZoneTest < OpenX::TestCase
4
+ def test_create
5
+ params = init_params
6
+ zone = Zone.create!(params)
7
+ assert_not_nil zone
8
+ params.each do |k,v|
9
+ assert_equal(v, zone.send(:"#{k}"))
10
+ end
11
+ zone.destroy
12
+ end
13
+
14
+ def test_find
15
+ params = init_params
16
+ zone = Zone.create!(params)
17
+ assert_not_nil zone
18
+ found_zone = Zone.find(zone.id)
19
+ assert_not_nil found_zone
20
+ assert_equal(zone, found_zone)
21
+ zone.destroy
22
+ end
23
+
24
+ def test_find_all
25
+ params = init_params
26
+ zone = Zone.create!(params)
27
+ assert_not_nil zone
28
+
29
+ zones = Zone.find(:all, publisher.id)
30
+ assert_equal(zones.sort, publisher.zones.sort)
31
+ found_zone = zones.find { |z| z.id == zone.id }
32
+ assert found_zone
33
+ assert_equal(zone, found_zone)
34
+ zone.destroy
35
+ end
36
+
37
+ def test_destroy
38
+ params = init_params
39
+ zone = Zone.create!(params)
40
+ assert_not_nil zone
41
+ id = zone.id
42
+ assert_nothing_raised {
43
+ zone.destroy
44
+ }
45
+ assert_raises(XMLRPC::FaultException) {
46
+ Zone.find(id)
47
+ }
48
+ end
49
+
50
+ def test_update
51
+ params = init_params
52
+ zone = Zone.create!(params)
53
+ assert_not_nil zone
54
+
55
+ found_zone = Zone.find(zone.id)
56
+ found_zone.name = 'tenderlove'
57
+ found_zone.save!
58
+
59
+ found_zone = Zone.find(zone.id)
60
+ assert_equal('tenderlove', found_zone.name)
61
+ end
62
+
63
+ def test_link_campaign
64
+ assert zone.link_campaign(campaign)
65
+ end
66
+
67
+ def test_unlink_campaign
68
+ assert_raises(XMLRPC::FaultException) {
69
+ zone.unlink_campaign(campaign)
70
+ }
71
+ assert zone.link_campaign(campaign)
72
+ assert zone.unlink_campaign(campaign)
73
+ end
74
+
75
+ def test_link_banner
76
+ assert zone.link_banner(banner)
77
+ end
78
+
79
+ def test_unlink_banner
80
+ assert_raises(XMLRPC::FaultException) {
81
+ zone.unlink_banner(banner)
82
+ }
83
+ assert zone.link_banner(banner)
84
+ assert zone.unlink_banner(banner)
85
+ end
86
+
87
+ def test_generate_tags
88
+ assert_match(/iframe/, zone.generate_tags)
89
+ end
90
+
91
+ def init_params
92
+ {
93
+ :publisher => publisher,
94
+ :name => "Zone - #{Time.now}",
95
+ :type => Zone::BANNER,
96
+ :width => 468,
97
+ :height => 60,
98
+ }
99
+ end
100
+ end
@@ -0,0 +1,77 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{touchlocal-openx}
8
+ s.version = "1.1.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Aaron Patterson", "Andy Smith", "TouchLocal Plc"]
12
+ s.date = %q{2009-10-26}
13
+ s.description = %q{A Ruby interface to the OpenX XML-RPC API}
14
+ s.email = %q{info@touchlocal.com}
15
+ s.extra_rdoc_files = [
16
+ "README.txt"
17
+ ]
18
+ s.files = [
19
+ ".gitignore",
20
+ "History.txt",
21
+ "Manifest.txt",
22
+ "README.txt",
23
+ "Rakefile",
24
+ "VERSION",
25
+ "lib/openx.rb",
26
+ "lib/openx/image.rb",
27
+ "lib/openx/invocation.rb",
28
+ "lib/openx/services.rb",
29
+ "lib/openx/services/advertiser.rb",
30
+ "lib/openx/services/agency.rb",
31
+ "lib/openx/services/banner.rb",
32
+ "lib/openx/services/base.rb",
33
+ "lib/openx/services/campaign.rb",
34
+ "lib/openx/services/publisher.rb",
35
+ "lib/openx/services/session.rb",
36
+ "lib/openx/services/zone.rb",
37
+ "lib/openx/xmlrpc_client.rb",
38
+ "test/assets/300x250.jpg",
39
+ "test/assets/cat.swf",
40
+ "test/helper.rb",
41
+ "test/test_advertiser.rb",
42
+ "test/test_agency.rb",
43
+ "test/test_banner.rb",
44
+ "test/test_base.rb",
45
+ "test/test_campaign.rb",
46
+ "test/test_publisher.rb",
47
+ "test/test_session.rb",
48
+ "test/test_zone.rb"
49
+ ]
50
+ s.homepage = %q{http://github.com/touchlocal/openx}
51
+ s.rdoc_options = ["--charset=UTF-8"]
52
+ s.require_paths = ["lib"]
53
+ s.rubygems_version = %q{1.3.5}
54
+ s.summary = %q{A Ruby interface to the OpenX XML-RPC API}
55
+ s.test_files = [
56
+ "test/helper.rb",
57
+ "test/test_advertiser.rb",
58
+ "test/test_agency.rb",
59
+ "test/test_banner.rb",
60
+ "test/test_base.rb",
61
+ "test/test_campaign.rb",
62
+ "test/test_publisher.rb",
63
+ "test/test_session.rb",
64
+ "test/test_zone.rb"
65
+ ]
66
+
67
+ if s.respond_to? :specification_version then
68
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
69
+ s.specification_version = 3
70
+
71
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
72
+ else
73
+ end
74
+ else
75
+ end
76
+ end
77
+
metadata ADDED
@@ -0,0 +1,95 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: touchlocal-openx
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Aaron Patterson
8
+ - Andy Smith
9
+ - TouchLocal Plc
10
+ autorequire:
11
+ bindir: bin
12
+ cert_chain: []
13
+
14
+ date: 2009-10-26 00:00:00 +10:00
15
+ default_executable:
16
+ dependencies: []
17
+
18
+ description: A Ruby interface to the OpenX XML-RPC API
19
+ email: info@touchlocal.com
20
+ executables: []
21
+
22
+ extensions: []
23
+
24
+ extra_rdoc_files:
25
+ - README.txt
26
+ files:
27
+ - .gitignore
28
+ - History.txt
29
+ - Manifest.txt
30
+ - README.txt
31
+ - Rakefile
32
+ - VERSION
33
+ - lib/openx.rb
34
+ - lib/openx/image.rb
35
+ - lib/openx/invocation.rb
36
+ - lib/openx/services.rb
37
+ - lib/openx/services/advertiser.rb
38
+ - lib/openx/services/agency.rb
39
+ - lib/openx/services/banner.rb
40
+ - lib/openx/services/base.rb
41
+ - lib/openx/services/campaign.rb
42
+ - lib/openx/services/publisher.rb
43
+ - lib/openx/services/session.rb
44
+ - lib/openx/services/zone.rb
45
+ - lib/openx/xmlrpc_client.rb
46
+ - test/assets/300x250.jpg
47
+ - test/assets/cat.swf
48
+ - test/helper.rb
49
+ - test/test_advertiser.rb
50
+ - test/test_agency.rb
51
+ - test/test_banner.rb
52
+ - test/test_base.rb
53
+ - test/test_campaign.rb
54
+ - test/test_publisher.rb
55
+ - test/test_session.rb
56
+ - test/test_zone.rb
57
+ - touchlocal-openx.gemspec
58
+ has_rdoc: true
59
+ homepage: http://github.com/touchlocal/openx
60
+ licenses: []
61
+
62
+ post_install_message:
63
+ rdoc_options:
64
+ - --charset=UTF-8
65
+ require_paths:
66
+ - lib
67
+ required_ruby_version: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ version: "0"
72
+ version:
73
+ required_rubygems_version: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ version: "0"
78
+ version:
79
+ requirements: []
80
+
81
+ rubyforge_project:
82
+ rubygems_version: 1.3.5
83
+ signing_key:
84
+ specification_version: 3
85
+ summary: A Ruby interface to the OpenX XML-RPC API
86
+ test_files:
87
+ - test/helper.rb
88
+ - test/test_advertiser.rb
89
+ - test/test_agency.rb
90
+ - test/test_banner.rb
91
+ - test/test_base.rb
92
+ - test/test_campaign.rb
93
+ - test/test_publisher.rb
94
+ - test/test_session.rb
95
+ - test/test_zone.rb