public
Description: Gitorious aims to provide a great way of doing distributed opensource code collaboration.
Homepage: http://gitorious.org/projects/gitorious
Clone URL: git://github.com/dysinger/gitorious.git
Search Repo:
Updated some of the helper specs to the new-style
Johan Sørensen (author)
Sun Jun 01 10:30:10 -0700 2008
commit  5b6844692e9d34478e00a9e7800a594e6050afc4
tree    19c279a8cf527c9416dec287d6f39feef5713c94
parent  1fd8b278636921d9be169dfaaadbaa9c2d14ace3
...
11
12
13
14
15
16
17
...
11
12
13
 
14
15
16
0
@@ -11,7 +11,6 @@ config.whiny_nils = true
0
 # Show full error reports and disable caching
0
 config.action_controller.consider_all_requests_local = true
0
 config.action_controller.perform_caching = false
0
-config.action_view.cache_template_extensions = false
0
 config.action_view.debug_rjs = true
0
 
0
 # ActionMailer::Base.default_url_options[:protocol] = 'https'
...
14
15
16
17
18
19
20
...
14
15
16
 
17
18
19
0
@@ -14,7 +14,6 @@ config.log_level = :warn
0
 # Full error reports are disabled and caching is turned on
0
 config.action_controller.consider_all_requests_local = false
0
 config.action_controller.perform_caching = true
0
-config.action_view.cache_template_extensions = true
0
 
0
 cache_dir = File.expand_path(File.join(RAILS_ROOT, 'public', 'cache'))
0
 config.action_controller.page_cache_directory = cache_dir
...
4
5
6
7
 
8
9
10
11
12
13
 
14
15
16
...
19
20
21
22
 
23
24
25
...
27
28
29
30
31
32
33
34
 
 
 
 
 
35
36
37
38
39
40
41
 
42
43
44
...
46
47
48
49
 
50
51
52
53
54
55
56
 
57
58
59
...
4
5
6
 
7
8
9
10
11
12
 
13
14
15
16
...
19
20
21
 
22
23
24
25
...
27
28
29
 
 
 
 
 
30
31
32
33
34
35
36
37
38
39
40
 
41
42
43
44
...
46
47
48
 
49
50
51
52
53
54
55
 
56
57
58
59
0
@@ -4,13 +4,13 @@ describe ApplicationHelper do
0
   
0
   it "renders a message if an object is not ready?" do
0
     repos = repositories(:johans)
0
- build_notice_for(repos).should include("This repository is being created")
0
+ helper.build_notice_for(repos).should include("This repository is being created")
0
   end
0
   
0
   it "renders block if object is ready" do
0
     obj = mock("any given object")
0
     obj.stub!(:ready?).and_return(true)
0
- render_if_ready(obj) do
0
+ helper.render_if_ready(obj) do
0
       "moo"
0
     end.should == "moo"
0
   end
0
@@ -19,7 +19,7 @@ describe ApplicationHelper do
0
     obj = mock("any given object")
0
     obj.stub!(:ready?).and_return(false)
0
     _erbout = "" # damn you RSpec!
0
- render_if_ready(obj) do
0
+ helper.render_if_ready(obj) do
0
       "moo"
0
     end
0
     _erbout.should_not == "moo"
0
@@ -27,18 +27,18 @@ describe ApplicationHelper do
0
   end
0
   
0
   it "gives us the domain of a full url" do
0
- base_url("http://foo.com").should == "foo.com"
0
- base_url("http://www.foo.com").should == "www.foo.com"
0
- base_url("http://foo.bar.baz.com").should == "foo.bar.baz.com"
0
- base_url("http://foo.com/").should == "foo.com"
0
- base_url("http://foo.com/bar/baz").should == "foo.com"
0
+ helper.base_url("http://foo.com").should == "foo.com"
0
+ helper.base_url("http://www.foo.com").should == "www.foo.com"
0
+ helper.base_url("http://foo.bar.baz.com").should == "foo.bar.baz.com"
0
+ helper.base_url("http://foo.com/").should == "foo.com"
0
+ helper.base_url("http://foo.com/bar/baz").should == "foo.com"
0
   end
0
   
0
   it "generates a valid gravatar url" do
0
     email = "someone@myemail.com";
0
     url = gravatar_url_for(email)
0
     
0
- base_url(url).should == "www.gravatar.com"
0
+ helper.base_url(url).should == "www.gravatar.com"
0
     url.include?(Digest::MD5.hexdigest(email)).should == true
0
     url.include?("avatar.php?").should == true
0
   end
0
@@ -46,14 +46,14 @@ describe ApplicationHelper do
0
     
0
   it "should generate a blank commit graph url if the graph isn't there" do
0
     File.should_receive(:exist?).and_return(false)
0
- url = commit_graph_tag(repositories(:johans))
0
+ url = helper.commit_graph_tag(repositories(:johans))
0
     url.should == nil
0
   end
0
   
0
   it "should generate a blank url for commit graph by author if the graph isn't there" do
0
     File.should_receive(:exist?).and_return(false)
0
     
0
- url = commit_graph_by_author_tag(repositories(:johans))
0
+ url = helper.commit_graph_by_author_tag(repositories(:johans))
0
     url.should == nil
0
   end
0
 end
...
2
3
4
 
 
 
 
5
6
 
7
8
9
10
11
 
 
12
13
14
15
 
16
17
18
19
20
21
 
22
23
24
25
26
27
28
 
29
30
31
...
33
34
35
36
 
37
38
39
40
41
42
 
43
44
45
46
47
 
 
48
49
50
51
52
53
54
 
 
55
56
57
...
2
3
4
5
6
7
8
9
 
10
11
12
13
 
 
14
15
16
17
18
 
19
20
21
22
23
24
 
25
26
27
28
29
30
31
 
32
33
34
35
...
37
38
39
 
40
41
42
43
44
45
 
46
47
48
49
 
 
50
51
52
53
54
55
56
 
 
57
58
59
60
61
0
@@ -2,30 +2,34 @@ require File.dirname(__FILE__) + '/../spec_helper'
0
 
0
 describe BlobsHelper do
0
   
0
+ def included_modules
0
+ (class << helper; self; end).send(:included_modules)
0
+ end
0
+
0
   it "includes the RepostoriesHelper" do
0
- self.class.ancestors.should include(RepositoriesHelper)
0
+ included_modules.should include(RepositoriesHelper)
0
   end
0
   
0
   it "includes the TreesHelper" do
0
- self.class.ancestors.should include(TreesHelper)
0
- end
0
+ included_modules.should include(TreesHelper)
0
+ end
0
   
0
   describe "line_numbers_for" do
0
     it "renders something with line numbers" do
0
- numbered = line_numbers_for("foo\nbar\nbaz")
0
+ numbered = helper.line_numbers_for("foo\nbar\nbaz")
0
       numbered.should include(%Q{<td class="line-numbers"><a href="#line2" name="line2">2</a></td>})
0
       numbered.should include(%Q{<td class="code">bar</td>})
0
     end
0
   
0
     it "renders one line with line numbers" do
0
- numbered = line_numbers_for("foo")
0
+ numbered = helper.line_numbers_for("foo")
0
       numbered.should include(%Q{<td class="line-numbers"><a href="#line1" name="line1">1</a></td>})
0
       numbered.should include(%Q{<td class="code">foo</td>})
0
     end
0
   
0
     it "doesn't blow up when with_line_numbers receives nil" do
0
       proc{
0
- line_numbers_for(nil).should == %Q{<table id="codeblob" class="highlighted">\n</table>}
0
+ helper.line_numbers_for(nil).should == %Q{<table id="codeblob" class="highlighted">\n</table>}
0
       }.should_not raise_error
0
     end
0
   end
0
@@ -33,25 +37,25 @@ describe BlobsHelper do
0
   describe "render_highlighted()" do
0
     it "tries to figure out the filetype" do
0
       Uv.should_receive(:syntax_names_for_data).with("foo.rb", "puts 'foo'").and_return(["ruby"])
0
- render_highlighted("puts 'foo'", "foo.rb")
0
+ helper.render_highlighted("puts 'foo'", "foo.rb")
0
     end
0
     
0
     it "parses the text" do
0
       Uv.should_receive(:syntax_names_for_data).with("foo.rb", "puts 'foo'").and_return(["ruby"])
0
       Uv.should_receive(:parse).and_return("puts 'foo'")
0
- render_highlighted("puts 'foo'", "foo.rb")
0
+ helper.render_highlighted("puts 'foo'", "foo.rb")
0
     end
0
     
0
     it "adds linenumbers" do
0
- should_receive(:line_numbers_for).and_return(123)
0
- render_highlighted("puts 'foo'", "foo.rb")
0
+ helper.should_receive(:line_numbers_for).and_return(123)
0
+ helper.render_highlighted("puts 'foo'", "foo.rb")
0
     end
0
   end
0
   
0
   describe "too_big_to_render" do
0
     it "knows when a blob is too big to be rendered within reasonable time" do
0
- too_big_to_render?(1.kilobyte).should == false
0
- too_big_to_render?(150.kilobyte+1).should == true
0
+ helper.too_big_to_render?(1.kilobyte).should == false
0
+ helper.too_big_to_render?(150.kilobyte+1).should == true
0
     end
0
   end
0
   
...
3
4
5
6
 
 
7
8
9
...
22
23
24
25
 
26
27
28
29
30
31
32
 
33
34
35
36
 
37
38
39
...
3
4
5
 
6
7
8
9
10
...
23
24
25
 
26
27
28
29
30
31
32
 
33
34
35
36
 
37
38
39
40
0
@@ -3,7 +3,8 @@ require File.dirname(__FILE__) + '/../spec_helper'
0
 describe CommitsHelper do
0
   
0
   it "includes the RepostoriesHelper" do
0
- self.class.ancestors.should include(RepositoriesHelper)
0
+ included_modules = (class << helper; self; end).send(:included_modules)
0
+ included_modules.should include(RepositoriesHelper)
0
   end
0
   
0
   describe "render_diff_stats" do
0
@@ -22,18 +23,18 @@ describe CommitsHelper do
0
     
0
     it "renders a list of files as anchor links" do
0
       files = @stats.files.keys
0
- rendered_stats = render_diff_stats(@stats)
0
+ rendered_stats = helper.render_diff_stats(@stats)
0
       files.each do |filename|
0
         rendered_stats.should include(%Q{<li><a href="##{h(filename)}">#{h(filename)}</a>})
0
       end
0
     end
0
     
0
     it "renders a graph of minuses for deletions" do
0
- render_diff_stats(@stats).should include(%Q{spec/database_spec.rb</a>&nbsp;17&nbsp;<small class="deletions">#{"-"*12}</small>})
0
+ helper.render_diff_stats(@stats).should include(%Q{spec/database_spec.rb</a>&nbsp;17&nbsp;<small class="deletions">#{"-"*12}</small>})
0
     end
0
     
0
     it "renders a graph of plusses for inserts" do
0
- render_diff_stats(@stats).should match(
0
+ helper.render_diff_stats(@stats).should match(
0
         /spec\/database_spec\.rb<\/a>&nbsp;17&nbsp;<small class="deletions.+<\/small><small class="insertions">#{"\\+"*5}<\/small>/
0
       )
0
     end
...
3
4
5
6
 
 
7
8
...
3
4
5
 
6
7
8
9
0
@@ -3,6 +3,7 @@ require File.dirname(__FILE__) + '/../spec_helper'
0
 describe LogsHelper do
0
   
0
   it "includes the RepostoriesHelper" do
0
- self.class.ancestors.should include(RepositoriesHelper)
0
+ included_modules = (class << helper; self; end).send(:included_modules)
0
+ included_modules.should include(RepositoriesHelper)
0
   end
0
 end
...
3
4
5
6
 
 
7
8
9
...
3
4
5
 
6
7
8
9
10
0
@@ -3,7 +3,8 @@ require File.dirname(__FILE__) + '/../spec_helper'
0
 describe TreesHelper do
0
   
0
   it "includes the RepostoriesHelper" do
0
- self.class.ancestors.should include(RepositoriesHelper)
0
+ included_modules = (class << helper; self; end).send(:included_modules)
0
+ included_modules.should include(RepositoriesHelper)
0
   end
0
   
0
   describe "commit_for_tree_path" do
...
11
12
13
14
 
15
16
17
18
19
20
 
21
22
...
11
12
13
 
14
15
16
17
18
19
 
20
21
22
0
@@ -11,12 +11,12 @@ describe UsersHelper do
0
       Need to investigate if this is a Rails bug and
0
       either fix it there or let go of obfuscation.
0
     }
0
- #pending(message) do
0
+ pending(message) do
0
       email = "aAT@NOSPAM@bDOTcom"
0
       encoded = (0...email.length).inject("") do |result, index|
0
         result << sprintf("%%%x",email[index])
0
       end
0
       helper.encoded_mail_to("a@b.com").should match(/#{encoded}/)
0
- #end
0
+ end
0
   end
0
 end
...
1
2
3
4
5
6
7
...
1
2
 
 
3
4
5
0
@@ -1,7 +1,5 @@
0
 require 'spec/interop/test'
0
 
0
-ActionView::Base.cache_template_extensions = false
0
-
0
 module Spec
0
   module Rails
0
 

Comments

    No one has commented yet.