motiro 0.6.9 → 0.6.10
Sign up to get free protection for your applications and to get access to all the features.
- data/README +1 -1
- data/Rakefile +2 -2
- data/app/core/version.rb +1 -1
- data/app/helpers/feed_helper.rb +2 -0
- data/app/reporters/darcs_reporter.rb +2 -3
- data/app/views/events/new.rhtml +14 -0
- data/app/views/feed/subversion.rhtml +26 -0
- data/app/views/report/events_detail.rhtml +12 -0
- data/build/build.rb +29 -0
- data/config/boot.rb +104 -14
- data/config/environment.rb +35 -38
- data/config/environments/development.rb +5 -7
- data/config/environments/production.rb +3 -3
- data/config/environments/test.rb +5 -2
- data/config/initializers/globalize.rb +5 -0
- data/config/initializers/inflections.rb +10 -0
- data/config/initializers/mime_types.rb +5 -0
- data/config/initializers/motiro_core.rb +5 -0
- data/config/motiro.yml +4 -4
- data/config/report/subversion.yml +26 -0
- data/doc/README_FOR_APP +1 -1
- data/lib/login_system.rb +2 -2
- data/lib/tasks/packaging.rake +4 -4
- data/public/404.html +27 -5
- data/public/422.html +30 -0
- data/public/500.html +27 -5
- data/public/dispatch.rb +2 -2
- data/public/javascripts/application.js +2 -0
- data/public/javascripts/controls.js +532 -319
- data/public/javascripts/dragdrop.js +521 -133
- data/public/javascripts/effects.js +708 -442
- data/public/javascripts/prototype.js +3393 -953
- data/public/robots.txt +5 -1
- data/public/selenium/tests/TestMainPage.html +42 -0
- data/public/selenium/tests/TestReportHTML.html +42 -0
- data/public/selenium/tests/TestReportRSS.html +37 -0
- data/public/selenium/tests/TestSubversionOnMain.html +32 -0
- data/public/selenium/tests/TestSuite.html +26 -0
- data/script/about +1 -1
- data/script/console +1 -1
- data/script/destroy +1 -1
- data/script/generate +1 -1
- data/script/performance/request +3 -0
- data/script/plugin +1 -1
- data/script/process/inspector +3 -0
- data/script/runner +1 -1
- data/script/server +1 -1
- data/test/fixtures/headlines.yml +6 -6
- data/test/functional/report_controller_test.rb +18 -18
- data/test/functional/root_controller_test.rb +1 -1
- data/test/test_helper.rb +11 -1
- data/test/unit/chief_editor_test.rb +20 -26
- data/test/unit/darcs_reporter_test.rb +6 -0
- data/test/unit/headline_test.rb +25 -8
- data/vendor/plugins/cache_test-0.2/doc/classes/Cosinux/FragmentCacheTest/Assertions.html +364 -0
- data/vendor/plugins/cache_test-0.2/doc/classes/Cosinux/PageCacheTest/IntegrationTestMethods.html +261 -0
- data/vendor/plugins/cache_test-0.2/doc/created.rid +1 -0
- data/vendor/plugins/cache_test-0.2/doc/files/CHANGELOG.html +128 -0
- data/vendor/plugins/cache_test-0.2/doc/files/MIT-LICENSE.html +129 -0
- data/vendor/plugins/cache_test-0.2/doc/files/README.html +272 -0
- data/vendor/plugins/cache_test-0.2/doc/files/init_rb.html +109 -0
- data/vendor/plugins/cache_test-0.2/doc/files/lib/fragment_cache_test_rb.html +101 -0
- data/vendor/plugins/cache_test-0.2/doc/files/lib/page_cache_test_rb.html +101 -0
- data/vendor/plugins/cache_test-0.2/doc/fr_class_index.html +28 -0
- data/vendor/plugins/cache_test-0.2/doc/fr_file_index.html +32 -0
- data/vendor/plugins/cache_test-0.2/doc/fr_method_index.html +32 -0
- data/vendor/plugins/cache_test-0.2/doc/index.html +24 -0
- data/vendor/plugins/cache_test-0.2/doc/rdoc-style.css +208 -0
- data/vendor/plugins/caching_monkey_patch/init.rb +13 -0
- data/vendor/plugins/rails_cron/CHANGELOG +8 -0
- data/vendor/plugins/rails_cron/LICENSE +7 -0
- data/vendor/plugins/rails_cron/README +77 -0
- data/vendor/plugins/rails_cron/init.rb +16 -0
- data/vendor/plugins/rails_cron/lib/acts_as_background.rb +14 -0
- data/vendor/plugins/rails_cron/lib/rails_cron.rb +128 -0
- data/vendor/plugins/rails_cron/tasks/startup.rake +50 -0
- metadata +466 -406
data/public/robots.txt
CHANGED
@@ -1 +1,5 @@
|
|
1
|
-
# See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file
|
1
|
+
# See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file
|
2
|
+
#
|
3
|
+
# To ban all spiders from the entire site uncomment the next two lines:
|
4
|
+
# User-Agent: *
|
5
|
+
# Disallow: /
|
@@ -0,0 +1,42 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
|
5
|
+
<title>Test Report</title>
|
6
|
+
</head>
|
7
|
+
<body>
|
8
|
+
<table cellpadding="1" cellspacing="1" border="1">
|
9
|
+
<tbody>
|
10
|
+
<tr>
|
11
|
+
<td rowspan="1" colspan="3">Test Report<br>
|
12
|
+
</td>
|
13
|
+
</tr>
|
14
|
+
<tr>
|
15
|
+
<td>open</td>
|
16
|
+
<td>/</td>
|
17
|
+
<td> </td>
|
18
|
+
</tr>
|
19
|
+
<tr>
|
20
|
+
<td>assertTitle</td>
|
21
|
+
<td>exact:Motiro: Bem-vindo</td>
|
22
|
+
<td> </td>
|
23
|
+
</tr>
|
24
|
+
<tr>
|
25
|
+
<td>assertElementPresent</td>
|
26
|
+
<td>//div[@id='description']</td>
|
27
|
+
<td> </td>
|
28
|
+
</tr>
|
29
|
+
<tr>
|
30
|
+
<td>assertTextPresent</td>
|
31
|
+
<td>Seja bem-vindo!</td>
|
32
|
+
<td> </td>
|
33
|
+
</tr>
|
34
|
+
<tr>
|
35
|
+
<td>assertTextPresent</td>
|
36
|
+
<td>Motiro versão 0.2</td>
|
37
|
+
<td> </td>
|
38
|
+
</tr>
|
39
|
+
</tbody>
|
40
|
+
</table>
|
41
|
+
</body>
|
42
|
+
</html>
|
@@ -0,0 +1,42 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
|
5
|
+
<title>Test Report HTML</title>
|
6
|
+
</head>
|
7
|
+
<body>
|
8
|
+
<table cellpadding="1" cellspacing="1" border="1">
|
9
|
+
<tbody>
|
10
|
+
<tr>
|
11
|
+
<td rowspan="1" colspan="3">Test Report HTML<br>
|
12
|
+
</td>
|
13
|
+
</tr>
|
14
|
+
<tr>
|
15
|
+
<td>open</td>
|
16
|
+
<td>/report/subversion</td>
|
17
|
+
<td> </td>
|
18
|
+
</tr>
|
19
|
+
<tr>
|
20
|
+
<td>assertTextPresent</td>
|
21
|
+
<td>Últimas notícias do Subversion</td>
|
22
|
+
<td> </td>
|
23
|
+
</tr>
|
24
|
+
<tr>
|
25
|
+
<td>assertElementPresent</td>
|
26
|
+
<td>//img[@src='/images/rss.gif']</td>
|
27
|
+
<td> </td>
|
28
|
+
</tr>
|
29
|
+
<tr>
|
30
|
+
<td>clickAndWait</td>
|
31
|
+
<td>//img[@src='/images/rss.gif']</td>
|
32
|
+
<td> </td>
|
33
|
+
</tr>
|
34
|
+
<tr>
|
35
|
+
<td>assertLocation</td>
|
36
|
+
<td>/feed/subversion</td>
|
37
|
+
<td> </td>
|
38
|
+
</tr>
|
39
|
+
</tbody>
|
40
|
+
</table>
|
41
|
+
</body>
|
42
|
+
</html>
|
@@ -0,0 +1,37 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
|
5
|
+
<title>Test Report RSS</title>
|
6
|
+
</head>
|
7
|
+
<body>
|
8
|
+
<table cellpadding="1" cellspacing="1" border="1">
|
9
|
+
<tbody>
|
10
|
+
<tr>
|
11
|
+
<td rowspan="1" colspan="3">Test Report RSS<br>
|
12
|
+
</td>
|
13
|
+
</tr>
|
14
|
+
<tr>
|
15
|
+
<td>open</td>
|
16
|
+
<td>/feed/subversion</td>
|
17
|
+
<td> </td>
|
18
|
+
</tr>
|
19
|
+
<tr>
|
20
|
+
<td>assertText</td>
|
21
|
+
<td>//rss/channel/title</td>
|
22
|
+
<td>Motiro - Subversion</td>
|
23
|
+
</tr>
|
24
|
+
<tr>
|
25
|
+
<td>assertElementPresent</td>
|
26
|
+
<td>//rss/channel/description</td>
|
27
|
+
<td> </td>
|
28
|
+
</tr>
|
29
|
+
<tr>
|
30
|
+
<td>assertText</td>
|
31
|
+
<td>//rss/channel/generator</td>
|
32
|
+
<td>exact:Motiro</td>
|
33
|
+
</tr>
|
34
|
+
</tbody>
|
35
|
+
</table>
|
36
|
+
</body>
|
37
|
+
</html>
|
@@ -0,0 +1,32 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
|
5
|
+
<title>Test Report</title>
|
6
|
+
</head>
|
7
|
+
<body>
|
8
|
+
<table cellpadding="1" cellspacing="1" border="1">
|
9
|
+
<tbody>
|
10
|
+
<tr>
|
11
|
+
<td rowspan="1" colspan="3">Test Report<br>
|
12
|
+
</td>
|
13
|
+
</tr>
|
14
|
+
<tr>
|
15
|
+
<td>open</td>
|
16
|
+
<td>/</td>
|
17
|
+
<td> </td>
|
18
|
+
</tr>
|
19
|
+
<tr>
|
20
|
+
<td>assertElementPresent</td>
|
21
|
+
<td>//div[@id = 'svn']</td>
|
22
|
+
<td> </td>
|
23
|
+
</tr>
|
24
|
+
<tr>
|
25
|
+
<td>assertTextPresent</td>
|
26
|
+
<td>Últimas notícias do Subversion</td>
|
27
|
+
<td> </td>
|
28
|
+
</tr>
|
29
|
+
</tbody>
|
30
|
+
</table>
|
31
|
+
</body>
|
32
|
+
</html>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<!--
|
2
|
+
Insipired on the original Selenium TestSuite.html by ThoughtWorks Inc.
|
3
|
+
-->
|
4
|
+
<html>
|
5
|
+
<head>
|
6
|
+
<meta content="text/html; charset=UTF-=8" http-equiv="content-type">
|
7
|
+
<title>Test Suite</title>
|
8
|
+
|
9
|
+
</head>
|
10
|
+
|
11
|
+
<body>
|
12
|
+
|
13
|
+
<table cellpadding="1"
|
14
|
+
cellspacing="1"
|
15
|
+
border="1">
|
16
|
+
<tbody>
|
17
|
+
<tr><td><b>Test Suite</b></td></tr>
|
18
|
+
<tr><td><a href="./TestMainPage.html">TestMainPage</a></td></tr>
|
19
|
+
<tr><td><a href="./TestReportHTML.html">TestReportHTML</a></td></tr>
|
20
|
+
<tr><td><a href="./TestSubversionOnMain.html">TestSubversionOnMain</a></td></tr>
|
21
|
+
<tr><td><a href="./TestReportRSS.html">TestReportRSS</a></td></tr>
|
22
|
+
</tbody>
|
23
|
+
</table>
|
24
|
+
|
25
|
+
</body>
|
26
|
+
</html>
|
data/script/about
CHANGED
data/script/console
CHANGED
data/script/destroy
CHANGED
data/script/generate
CHANGED
data/script/plugin
CHANGED
data/script/runner
CHANGED
data/script/server
CHANGED
data/test/fixtures/headlines.yml
CHANGED
@@ -5,8 +5,8 @@ gita:
|
|
5
5
|
author: raulseixas
|
6
6
|
description: gita
|
7
7
|
happened_at: 2005-01-01 00:00:00
|
8
|
-
reported_by:
|
9
|
-
rid:
|
8
|
+
reported_by: darcs
|
9
|
+
rid: 20050101000000-9043f-5f2e84cdc6ce0e5eea4a7fbedc01d63f4b956f56
|
10
10
|
|
11
11
|
dia_em_que_a_terra_parou:
|
12
12
|
id: 2
|
@@ -16,13 +16,13 @@ dia_em_que_a_terra_parou:
|
|
16
16
|
reported_by: subversion
|
17
17
|
rid: r16
|
18
18
|
|
19
|
-
|
19
|
+
demo_headline:
|
20
20
|
id: 3
|
21
21
|
author: james
|
22
22
|
happened_at: 2006-03-23 11:10:04
|
23
|
-
reported_by:
|
24
|
-
rid:
|
25
|
-
description: This is a
|
23
|
+
reported_by: darcs
|
24
|
+
rid: 20060323111004-9043f-27bf64adfd9f00bb935ab5e2dbd86cc4e4b5bebd
|
25
|
+
description: This is a Darcs revision comment
|
26
26
|
|
27
27
|
The comment is a multiline comment that indicates the purpose
|
28
28
|
of the revision.
|
@@ -35,10 +35,10 @@ class ReportControllerTest < Test::Unit::TestCase
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def test_fetches_headlines_from_cache
|
38
|
-
get :list, { :reporter => '
|
38
|
+
get :list, { :reporter => 'darcs' }
|
39
39
|
assert_response :success
|
40
40
|
assert_not_nil assigns(:headlines)
|
41
|
-
expected = Headline.find(:all, :conditions => "reported_by = '
|
41
|
+
expected = Headline.find(:all, :conditions => "reported_by = 'darcs'")
|
42
42
|
assert_equal expected.size, assigns(:headlines).size
|
43
43
|
end
|
44
44
|
|
@@ -49,30 +49,30 @@ class ReportControllerTest < Test::Unit::TestCase
|
|
49
49
|
end
|
50
50
|
|
51
51
|
def test_fetches_individual_headline_based_on_rid
|
52
|
-
|
53
|
-
get :show, { :reporter =>
|
54
|
-
:id =>
|
52
|
+
demo_headline = headlines('demo_headline')
|
53
|
+
get :show, { :reporter => demo_headline.reported_by,
|
54
|
+
:id => demo_headline.rid }
|
55
55
|
assert_response :success
|
56
56
|
assert_not_nil assigns(:headline)
|
57
57
|
end
|
58
58
|
|
59
59
|
def test_calling_show_with_an_id_delegates_to_chief_editor
|
60
60
|
FlexMock.use do |editor|
|
61
|
-
editor.should_receive(:reporter_with).with('
|
62
|
-
and_return(
|
63
|
-
editor.should_receive(:headline_with).with('
|
64
|
-
returns(headlines('
|
61
|
+
editor.should_receive(:reporter_with).with('darcs').
|
62
|
+
and_return(DarcsReporter.new)
|
63
|
+
editor.should_receive(:headline_with).with('darcs', '3').
|
64
|
+
returns(headlines('demo_headline')).
|
65
65
|
once
|
66
66
|
|
67
67
|
@controller = ReportController.new(editor)
|
68
68
|
|
69
|
-
get :show, {:reporter => '
|
69
|
+
get :show, {:reporter => 'darcs', :id => 3}
|
70
70
|
end
|
71
71
|
end
|
72
72
|
|
73
73
|
def test_calling_show_with_invalid_rid_redirects_to_index
|
74
|
-
get :show, { :reporter => '
|
75
|
-
assert_equal 'The article
|
74
|
+
get :show, { :reporter => 'darcs', :id => 'aaaa' }
|
75
|
+
assert_equal 'The article aaaa from the Darcs reporter could not be found', flash[:notice]
|
76
76
|
assert_redirected_to :controller => 'root', :action => 'index'
|
77
77
|
end
|
78
78
|
|
@@ -88,19 +88,19 @@ class ReportControllerTest < Test::Unit::TestCase
|
|
88
88
|
#TODO more headlines registered than the package size
|
89
89
|
|
90
90
|
def test_shows_breadcrumbs_trail_for_subversion_revision_pages
|
91
|
-
|
92
|
-
get :show, :reporter =>
|
91
|
+
demo = headlines('demo_headline')
|
92
|
+
get :show, :reporter => demo.reported_by, :id => demo.rid
|
93
93
|
|
94
94
|
assert_xml_element "//div[@id = 'crumbs' and contains(text(), 'You are here')]/a[@href = '/' and text() = 'Home']"
|
95
|
-
assert_xml_element "//div[@id = 'crumbs']/a[@href = '/report/older/
|
96
|
-
assert_xml_element "//div[@id = 'crumbs']/a[@href = '#{@controller.url_for(:controller => 'report', :action => 'show', :reporter => '
|
95
|
+
assert_xml_element "//div[@id = 'crumbs']/a[@href = '/report/older/darcs' and text() = 'Latest news from Darcs']"
|
96
|
+
assert_xml_element "//div[@id = 'crumbs']/a[@href = '#{@controller.url_for(:controller => 'report', :action => 'show', :reporter => 'darcs', :id => demo.rid, :only_path => true)}' and text() = '#{demo.title}']"
|
97
97
|
end
|
98
98
|
|
99
99
|
def test_shows_breadcrumbs_trail_for_older_news_page
|
100
|
-
get :older, :reporter => '
|
100
|
+
get :older, :reporter => 'darcs'
|
101
101
|
|
102
102
|
assert_xml_element "//div[@id = 'crumbs' and contains(text(), 'You are here')]/a[@href = '/' and text() = 'Home']"
|
103
|
-
assert_xml_element "//div[@id = 'crumbs']/a[@href = '/report/older/
|
103
|
+
assert_xml_element "//div[@id = 'crumbs']/a[@href = '/report/older/darcs' and text() = 'Latest news from Darcs']"
|
104
104
|
end
|
105
105
|
|
106
106
|
private
|
data/test/test_helper.rb
CHANGED
@@ -42,7 +42,11 @@ class Test::Unit::TestCase
|
|
42
42
|
# in MySQL. Turn off transactional fixtures in this case; however, if you
|
43
43
|
# don't care one way or the other, switching from MyISAM to InnoDB tables
|
44
44
|
# is recommended.
|
45
|
-
|
45
|
+
#
|
46
|
+
# The only drawback to using transactional fixtures is when you actually
|
47
|
+
# need to test transactions. Since your test is bracketed by a transaction,
|
48
|
+
# any transactions started in your code will be automatically rolled back.
|
49
|
+
self.use_transactional_fixtures = true
|
46
50
|
|
47
51
|
# Instantiated fixtures are slow, but give you @david where otherwise you
|
48
52
|
# would need people(:david). If you don't want to migrate your existing
|
@@ -51,6 +55,12 @@ class Test::Unit::TestCase
|
|
51
55
|
# then set this back to true.
|
52
56
|
self.use_instantiated_fixtures = false
|
53
57
|
|
58
|
+
# Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
|
59
|
+
#
|
60
|
+
# Note: You'll currently still have to declare fixtures explicitly in integration tests
|
61
|
+
# -- they do not yet inherit this setting
|
62
|
+
fixtures :all
|
63
|
+
|
54
64
|
# Add more helper methods to be used by all tests here...
|
55
65
|
def bob; users('bob'); end
|
56
66
|
def john; users('john'); end
|
@@ -78,7 +78,6 @@ class ChiefEditorTest < Test::Unit::TestCase
|
|
78
78
|
FlexMock.use do |reporter|
|
79
79
|
settings = StubConnectionSettingsProvider.new(:update_interval => 0)
|
80
80
|
fetcher = { :active_reporters => [reporter] }
|
81
|
-
svn_demo_headline = headlines('svn_demo_headline')
|
82
81
|
|
83
82
|
reporter.should_receive(:name).returns('subversion')
|
84
83
|
reporter.should_receive(:latest_headlines).once.
|
@@ -92,11 +91,11 @@ class ChiefEditorTest < Test::Unit::TestCase
|
|
92
91
|
FlexMock.use do |reporter|
|
93
92
|
settings = StubConnectionSettingsProvider.new(:update_interval => 0)
|
94
93
|
fetcher = { :active_reporters => [reporter] }
|
95
|
-
|
94
|
+
demo_headline = headlines('demo_headline')
|
96
95
|
|
97
96
|
reporter.should_receive(:name).returns('subversion')
|
98
97
|
reporter.should_receive(:headlines).once.
|
99
|
-
returns([
|
98
|
+
returns([demo_headline])
|
100
99
|
|
101
100
|
ChiefEditor.new(settings, fetcher).news_from('subversion')
|
102
101
|
end
|
@@ -119,20 +118,19 @@ class ChiefEditorTest < Test::Unit::TestCase
|
|
119
118
|
FlexMock.use do |reporter|
|
120
119
|
settings = StubConnectionSettingsProvider.new(:update_interval => 0)
|
121
120
|
fetcher = { :active_reporters => [reporter] }
|
122
|
-
|
121
|
+
demo_headline = headlines('demo_headline')
|
123
122
|
|
124
|
-
reporter.should_receive(:name).
|
125
|
-
returns('subversion')
|
123
|
+
reporter.should_receive(:name).returns('darcs')
|
126
124
|
|
127
125
|
reporter.should_receive(:headline).
|
128
|
-
with(
|
129
|
-
returns(
|
126
|
+
with(demo_headline.rid).
|
127
|
+
returns(demo_headline).
|
130
128
|
once
|
131
129
|
|
132
130
|
chief_editor = ChiefEditor.new(settings, fetcher)
|
133
131
|
|
134
|
-
chief_editor.headline_with(
|
135
|
-
|
132
|
+
chief_editor.headline_with(demo_headline.reported_by,
|
133
|
+
demo_headline.rid)
|
136
134
|
end
|
137
135
|
end
|
138
136
|
|
@@ -140,7 +138,7 @@ class ChiefEditorTest < Test::Unit::TestCase
|
|
140
138
|
FlexMock.use('1', '2') do |reporter, fetcher|
|
141
139
|
fetcher.should_receive(:active_reporters).and_return([reporter])
|
142
140
|
reporter.should_receive(:cache?).returns(true)
|
143
|
-
reporter.should_receive(:name).returns('
|
141
|
+
reporter.should_receive(:name).returns('darcs')
|
144
142
|
reporter.should_receive(:headline).never
|
145
143
|
|
146
144
|
|
@@ -148,14 +146,14 @@ class ChiefEditorTest < Test::Unit::TestCase
|
|
148
146
|
|
149
147
|
chief_editor = ChiefEditor.new(settings, fetcher)
|
150
148
|
|
151
|
-
|
149
|
+
demo_headline = headlines('demo_headline')
|
152
150
|
|
153
|
-
headline = chief_editor.headline_with(
|
154
|
-
|
151
|
+
headline = chief_editor.headline_with(demo_headline.reported_by,
|
152
|
+
demo_headline.rid)
|
155
153
|
|
156
154
|
reporter.mock_verify
|
157
155
|
|
158
|
-
assert_equal
|
156
|
+
assert_equal demo_headline.description, headline.description
|
159
157
|
end
|
160
158
|
end
|
161
159
|
|
@@ -184,26 +182,22 @@ class ChiefEditorTest < Test::Unit::TestCase
|
|
184
182
|
end
|
185
183
|
|
186
184
|
def test_retrieves_headlines_from_correct_reporter_on_cached_mode
|
187
|
-
FlexMock.use('1', '2', '3') do |events_reporter,
|
185
|
+
FlexMock.use('1', '2', '3') do |events_reporter, darcs_reporter, fetcher|
|
188
186
|
settings = StubConnectionSettingsProvider.new(:update_interval => 8)
|
189
187
|
|
190
188
|
events_reporter.should_receive(:name).returns('events')
|
191
189
|
events_reporter.should_receive(:cache?).returns(true)
|
192
|
-
|
193
|
-
|
190
|
+
darcs_reporter.should_receive(:name).returns('darcs')
|
191
|
+
darcs_reporter.should_receive(:cache?).returns(true)
|
194
192
|
fetcher.should_receive(:active_reporters).
|
195
|
-
and_return([events_reporter,
|
193
|
+
and_return([events_reporter, darcs_reporter]).
|
196
194
|
once
|
197
195
|
|
198
196
|
chief_editor = ChiefEditor.new(settings, fetcher)
|
199
197
|
|
200
|
-
|
201
|
-
|
202
|
-
assert_equal 1, events_news.size
|
198
|
+
assert_equal 1, chief_editor.latest_news_from('events').size
|
203
199
|
|
204
|
-
|
205
|
-
|
206
|
-
assert_equal 3, subversion_news.size
|
200
|
+
assert_equal 3, chief_editor.latest_news_from('darcs').size
|
207
201
|
end
|
208
202
|
end
|
209
203
|
|
@@ -231,4 +225,4 @@ class ChiefEditorTest < Test::Unit::TestCase
|
|
231
225
|
end
|
232
226
|
|
233
227
|
#TODO should signal when the reporter is not registered
|
234
|
-
end
|
228
|
+
end
|