ad_man 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/app/controllers/ad_man/advertisements_controller.rb +1 -1
- data/app/helpers/ad_man/application_helper.rb +0 -1
- data/app/models/ad_man/advertisement.rb +12 -8
- data/app/models/ad_man/keyword.rb +2 -1
- data/app/views/ad_man/advertisements/_form.html.erb +4 -2
- data/app/views/ad_man/keywords/show.html.erb +2 -2
- data/db/migrate/20120808095742_add_priority_to_ad_man_advertisements.rb +1 -1
- data/lib/ad_man/version.rb +1 -1
- data/lib/generators/ad_man/install_generator.rb +20 -0
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +594 -0
- data/test/dummy/log/test.log +1312 -0
- data/test/dummy/tmp/pids/server.pid +1 -0
- data/test/fixtures/ad_man/advertisements.yml +9 -6
- data/test/fixtures/ad_man/keywords.yml +3 -2
- data/test/fixtures/test.jpeg +0 -0
- data/test/fixtures/top_daintiness.jpeg +0 -0
- data/test/functional/ad_man/advertisements_controller_test.rb +3 -0
- data/test/test_helper.rb +4 -0
- data/test/unit/ad_man/advertisement_test.rb +38 -3
- data/test/unit/ad_man/keyword_test.rb +5 -3
- metadata +19 -20
- data/test/dummy/public/system/ad_man/advertisements/ad_banners/000/000/014/banner/1-NR-728x90-cool-b.gif +0 -0
- data/test/dummy/public/system/ad_man/advertisements/ad_banners/000/000/014/leaderboard/1-NR-728x90-cool-b.gif +0 -0
- data/test/dummy/public/system/ad_man/advertisements/ad_banners/000/000/014/original/1-NR-728x90-cool-b.gif +0 -0
- data/test/dummy/public/system/ad_man/advertisements/ad_banners/000/000/015/banner/9241eb4107b24c588c0ca0042534c03e.png +0 -0
- data/test/dummy/public/system/ad_man/advertisements/ad_banners/000/000/015/leaderboard/9241eb4107b24c588c0ca0042534c03e.png +0 -0
- data/test/dummy/public/system/ad_man/advertisements/ad_banners/000/000/015/original/9241eb4107b24c588c0ca0042534c03e.png +0 -0
- /data/test/dummy/public/system/ad_man/advertisements/ad_banners/000/000/{016/banner/d893babe671c41118c1fece177e0a21a.jpeg → 001/banner/test.jpeg} +0 -0
- /data/test/dummy/public/system/ad_man/advertisements/ad_banners/000/000/{016/leaderboard/d893babe671c41118c1fece177e0a21a.jpeg → 001/leaderboard/test.jpeg} +0 -0
- /data/test/dummy/public/system/ad_man/advertisements/ad_banners/000/000/{016/original/d893babe671c41118c1fece177e0a21a.jpeg → 001/original/test.jpeg} +0 -0
@@ -0,0 +1 @@
|
|
1
|
+
12603
|
@@ -1,9 +1,12 @@
|
|
1
1
|
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
rubyonrails:
|
4
|
+
id: 1
|
5
|
+
title: Ruby on Rails
|
6
|
+
destination_url: http://www.rubyonrails.org
|
7
|
+
keyword_id: 1
|
6
8
|
|
7
|
-
|
8
|
-
|
9
|
-
|
9
|
+
google:
|
10
|
+
id: 2
|
11
|
+
title: Google
|
12
|
+
destination_url: http://www.google.com
|
Binary file
|
Binary file
|
@@ -10,6 +10,7 @@ module AdMan
|
|
10
10
|
get :index
|
11
11
|
assert_response :success
|
12
12
|
assert_not_nil assigns(:advertisements)
|
13
|
+
assert_not_nil assigns(:keywords)
|
13
14
|
end
|
14
15
|
|
15
16
|
test "should get new" do
|
@@ -20,6 +21,8 @@ module AdMan
|
|
20
21
|
test "should create advertisement" do
|
21
22
|
assert_difference('Advertisement.count') do
|
22
23
|
post :create, advertisement: { destination_url: @advertisement.destination_url, title: @advertisement.title }
|
24
|
+
# ad_banner: @advertisement.ad_banner, :keyword_id, :start_date, :end_date
|
25
|
+
# }
|
23
26
|
end
|
24
27
|
|
25
28
|
assert_redirected_to advertisement_path(assigns(:advertisement))
|
data/test/test_helper.rb
CHANGED
@@ -13,3 +13,7 @@ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
|
13
13
|
if ActiveSupport::TestCase.method_defined?(:fixture_path=)
|
14
14
|
ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
|
15
15
|
end
|
16
|
+
|
17
|
+
def sample_file(filename = "test.jpeg")
|
18
|
+
File.new("test/fixtures/#{filename}")
|
19
|
+
end
|
@@ -2,8 +2,43 @@ require 'test_helper'
|
|
2
2
|
|
3
3
|
module AdMan
|
4
4
|
class AdvertisementTest < ActiveSupport::TestCase
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
|
6
|
+
# Paperclip responsible for this:
|
7
|
+
# test "should not save advertisement without ad_banner" do
|
8
|
+
# advertisement = Advertisement.new
|
9
|
+
# advertisement.ad_banner = nil
|
10
|
+
# assert !advertisement.save, "should not save without ad_banner"
|
11
|
+
# end
|
12
|
+
|
13
|
+
test "should not save advertisement without keyword" do
|
14
|
+
advertisement = Advertisement.new
|
15
|
+
advertisement.ad_banner = sample_file
|
16
|
+
assert !advertisement.keyword_id, "must have a keyword_id association"
|
17
|
+
assert !advertisement.save, "should not save without keyword_id"
|
18
|
+
end
|
19
|
+
|
20
|
+
test "properly save without destination_url and title" do
|
21
|
+
advertisement = Advertisement.new
|
22
|
+
advertisement.ad_banner = sample_file
|
23
|
+
keyword = Keyword.new
|
24
|
+
keyword.name = "Test"
|
25
|
+
keyword.save
|
26
|
+
advertisement.keyword_id = keyword.id
|
27
|
+
assert !advertisement.save, "should not save without destination_url and title"
|
28
|
+
end
|
29
|
+
|
30
|
+
test "properly save" do
|
31
|
+
advertisement = Advertisement.new
|
32
|
+
advertisement.ad_banner = sample_file
|
33
|
+
keyword = Keyword.new
|
34
|
+
keyword.name = "Test"
|
35
|
+
assert_nothing_raised do
|
36
|
+
keyword.save!
|
37
|
+
end
|
38
|
+
advertisement.keyword_id = keyword.id
|
39
|
+
advertisement.title = "test"
|
40
|
+
advertisement.destination_url = "test.com"
|
41
|
+
assert advertisement.save, "is this valid information?"
|
42
|
+
end
|
8
43
|
end
|
9
44
|
end
|
@@ -2,8 +2,10 @@ require 'test_helper'
|
|
2
2
|
|
3
3
|
module AdMan
|
4
4
|
class KeywordTest < ActiveSupport::TestCase
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
test "should not save keyword without name" do
|
6
|
+
keyword = Keyword.new
|
7
|
+
assert !keyword.save, "Saved the post without a keyword name"
|
8
|
+
end
|
8
9
|
end
|
10
|
+
|
9
11
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ad_man
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-08-
|
13
|
+
date: 2012-08-10 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|
@@ -105,6 +105,7 @@ files:
|
|
105
105
|
- lib/ad_man/engine.rb
|
106
106
|
- lib/ad_man/version.rb
|
107
107
|
- lib/ad_man.rb
|
108
|
+
- lib/generators/ad_man/install_generator.rb
|
108
109
|
- lib/tasks/ad_man_tasks.rake
|
109
110
|
- MIT-LICENSE
|
110
111
|
- Rakefile
|
@@ -134,26 +135,22 @@ files:
|
|
134
135
|
- test/dummy/config.ru
|
135
136
|
- test/dummy/db/development.sqlite3
|
136
137
|
- test/dummy/db/schema.rb
|
138
|
+
- test/dummy/db/test.sqlite3
|
137
139
|
- test/dummy/log/development.log
|
140
|
+
- test/dummy/log/test.log
|
138
141
|
- test/dummy/public/404.html
|
139
142
|
- test/dummy/public/422.html
|
140
143
|
- test/dummy/public/500.html
|
141
144
|
- test/dummy/public/favicon.ico
|
145
|
+
- test/dummy/public/system/ad_man/advertisements/ad_banners/000/000/001/banner/test.jpeg
|
146
|
+
- test/dummy/public/system/ad_man/advertisements/ad_banners/000/000/001/leaderboard/test.jpeg
|
142
147
|
- test/dummy/public/system/ad_man/advertisements/ad_banners/000/000/001/original/FabTable_01.jpg
|
148
|
+
- test/dummy/public/system/ad_man/advertisements/ad_banners/000/000/001/original/test.jpeg
|
143
149
|
- test/dummy/public/system/ad_man/advertisements/ad_banners/000/000/001/small/FabTable_01.jpg
|
144
150
|
- test/dummy/public/system/ad_man/advertisements/ad_banners/000/000/002/original/728x90_2MM.jpg
|
145
151
|
- test/dummy/public/system/ad_man/advertisements/ad_banners/000/000/002/original/d893babe671c41118c1fece177e0a21a.jpeg
|
146
152
|
- test/dummy/public/system/ad_man/advertisements/ad_banners/000/000/002/small/728x90_2MM.jpg
|
147
153
|
- test/dummy/public/system/ad_man/advertisements/ad_banners/000/000/002/small/d893babe671c41118c1fece177e0a21a.jpeg
|
148
|
-
- test/dummy/public/system/ad_man/advertisements/ad_banners/000/000/014/banner/1-NR-728x90-cool-b.gif
|
149
|
-
- test/dummy/public/system/ad_man/advertisements/ad_banners/000/000/014/leaderboard/1-NR-728x90-cool-b.gif
|
150
|
-
- test/dummy/public/system/ad_man/advertisements/ad_banners/000/000/014/original/1-NR-728x90-cool-b.gif
|
151
|
-
- test/dummy/public/system/ad_man/advertisements/ad_banners/000/000/015/banner/9241eb4107b24c588c0ca0042534c03e.png
|
152
|
-
- test/dummy/public/system/ad_man/advertisements/ad_banners/000/000/015/leaderboard/9241eb4107b24c588c0ca0042534c03e.png
|
153
|
-
- test/dummy/public/system/ad_man/advertisements/ad_banners/000/000/015/original/9241eb4107b24c588c0ca0042534c03e.png
|
154
|
-
- test/dummy/public/system/ad_man/advertisements/ad_banners/000/000/016/banner/d893babe671c41118c1fece177e0a21a.jpeg
|
155
|
-
- test/dummy/public/system/ad_man/advertisements/ad_banners/000/000/016/leaderboard/d893babe671c41118c1fece177e0a21a.jpeg
|
156
|
-
- test/dummy/public/system/ad_man/advertisements/ad_banners/000/000/016/original/d893babe671c41118c1fece177e0a21a.jpeg
|
157
154
|
- test/dummy/Rakefile
|
158
155
|
- test/dummy/README.rdoc
|
159
156
|
- test/dummy/script/rails
|
@@ -170,8 +167,11 @@ files:
|
|
170
167
|
- test/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994
|
171
168
|
- test/dummy/tmp/cache/assets/DF7/090/sprockets%2Fb3b1a32b0f923d6741fd5dacdf9f59ab
|
172
169
|
- test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af
|
170
|
+
- test/dummy/tmp/pids/server.pid
|
173
171
|
- test/fixtures/ad_man/advertisements.yml
|
174
172
|
- test/fixtures/ad_man/keywords.yml
|
173
|
+
- test/fixtures/test.jpeg
|
174
|
+
- test/fixtures/top_daintiness.jpeg
|
175
175
|
- test/functional/ad_man/advertisements_controller_test.rb
|
176
176
|
- test/functional/ad_man/keywords_controller_test.rb
|
177
177
|
- test/integration/navigation_test.rb
|
@@ -230,26 +230,22 @@ test_files:
|
|
230
230
|
- test/dummy/config.ru
|
231
231
|
- test/dummy/db/development.sqlite3
|
232
232
|
- test/dummy/db/schema.rb
|
233
|
+
- test/dummy/db/test.sqlite3
|
233
234
|
- test/dummy/log/development.log
|
235
|
+
- test/dummy/log/test.log
|
234
236
|
- test/dummy/public/404.html
|
235
237
|
- test/dummy/public/422.html
|
236
238
|
- test/dummy/public/500.html
|
237
239
|
- test/dummy/public/favicon.ico
|
240
|
+
- test/dummy/public/system/ad_man/advertisements/ad_banners/000/000/001/banner/test.jpeg
|
241
|
+
- test/dummy/public/system/ad_man/advertisements/ad_banners/000/000/001/leaderboard/test.jpeg
|
238
242
|
- test/dummy/public/system/ad_man/advertisements/ad_banners/000/000/001/original/FabTable_01.jpg
|
243
|
+
- test/dummy/public/system/ad_man/advertisements/ad_banners/000/000/001/original/test.jpeg
|
239
244
|
- test/dummy/public/system/ad_man/advertisements/ad_banners/000/000/001/small/FabTable_01.jpg
|
240
245
|
- test/dummy/public/system/ad_man/advertisements/ad_banners/000/000/002/original/728x90_2MM.jpg
|
241
246
|
- test/dummy/public/system/ad_man/advertisements/ad_banners/000/000/002/original/d893babe671c41118c1fece177e0a21a.jpeg
|
242
247
|
- test/dummy/public/system/ad_man/advertisements/ad_banners/000/000/002/small/728x90_2MM.jpg
|
243
248
|
- test/dummy/public/system/ad_man/advertisements/ad_banners/000/000/002/small/d893babe671c41118c1fece177e0a21a.jpeg
|
244
|
-
- test/dummy/public/system/ad_man/advertisements/ad_banners/000/000/014/banner/1-NR-728x90-cool-b.gif
|
245
|
-
- test/dummy/public/system/ad_man/advertisements/ad_banners/000/000/014/leaderboard/1-NR-728x90-cool-b.gif
|
246
|
-
- test/dummy/public/system/ad_man/advertisements/ad_banners/000/000/014/original/1-NR-728x90-cool-b.gif
|
247
|
-
- test/dummy/public/system/ad_man/advertisements/ad_banners/000/000/015/banner/9241eb4107b24c588c0ca0042534c03e.png
|
248
|
-
- test/dummy/public/system/ad_man/advertisements/ad_banners/000/000/015/leaderboard/9241eb4107b24c588c0ca0042534c03e.png
|
249
|
-
- test/dummy/public/system/ad_man/advertisements/ad_banners/000/000/015/original/9241eb4107b24c588c0ca0042534c03e.png
|
250
|
-
- test/dummy/public/system/ad_man/advertisements/ad_banners/000/000/016/banner/d893babe671c41118c1fece177e0a21a.jpeg
|
251
|
-
- test/dummy/public/system/ad_man/advertisements/ad_banners/000/000/016/leaderboard/d893babe671c41118c1fece177e0a21a.jpeg
|
252
|
-
- test/dummy/public/system/ad_man/advertisements/ad_banners/000/000/016/original/d893babe671c41118c1fece177e0a21a.jpeg
|
253
249
|
- test/dummy/Rakefile
|
254
250
|
- test/dummy/README.rdoc
|
255
251
|
- test/dummy/script/rails
|
@@ -266,8 +262,11 @@ test_files:
|
|
266
262
|
- test/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994
|
267
263
|
- test/dummy/tmp/cache/assets/DF7/090/sprockets%2Fb3b1a32b0f923d6741fd5dacdf9f59ab
|
268
264
|
- test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af
|
265
|
+
- test/dummy/tmp/pids/server.pid
|
269
266
|
- test/fixtures/ad_man/advertisements.yml
|
270
267
|
- test/fixtures/ad_man/keywords.yml
|
268
|
+
- test/fixtures/test.jpeg
|
269
|
+
- test/fixtures/top_daintiness.jpeg
|
271
270
|
- test/functional/ad_man/advertisements_controller_test.rb
|
272
271
|
- test/functional/ad_man/keywords_controller_test.rb
|
273
272
|
- test/integration/navigation_test.rb
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
File without changes
|
File without changes
|