irwi 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.3
1
+ 0.1.4
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{irwi}
8
- s.version = "0.1.3"
8
+ s.version = "0.1.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Alexey Noskov"]
12
- s.date = %q{2009-10-26}
12
+ s.date = %q{2009-10-27}
13
13
  s.description = %q{Irwi is Ruby on Rails plugin which adds wiki functionality to your application. }
14
14
  s.email = %q{alexey.noskov@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -88,7 +88,7 @@ module Irwi::Extensions::Controllers::WikiPages
88
88
 
89
89
  # Initialize @current_user instance variable
90
90
  def setup_current_user
91
- @current_user = respond_to?( :current_user ) ? current_user : nil # Find user by current_user method or return nil
91
+ @current_user = respond_to?( :current_user, true ) ? current_user : nil # Find user by current_user method or return nil
92
92
  end
93
93
 
94
94
  # Initialize @page instance variable
@@ -24,7 +24,7 @@ module Irwi::Helpers::WikiPagesHelper
24
24
  end
25
25
 
26
26
  def wiki_content( text )
27
- sanitize( wiki_linkify( Irwi.config.formatter.format( text ) ) )
27
+ sanitize( wiki_linkify( auto_link( Irwi.config.formatter.format( text ) ) ) )
28
28
  end
29
29
 
30
30
  def wiki_diff( old_text, new_text )
@@ -6,7 +6,15 @@ describe Irwi::Extensions::Controllers::WikiPages do
6
6
 
7
7
  class WikiPage; end
8
8
  class WikiPagesController < ActionController::Base
9
- include Irwi::Extensions::Controllers::WikiPages
9
+ include Irwi::Extensions::Controllers::WikiPages
10
+
11
+ private
12
+
13
+ def current_user
14
+ return @current_user if defined?(@current_user)
15
+ @current_user = 'Some user'
16
+ end
17
+
10
18
  end
11
19
 
12
20
  it { should_not be_nil }
@@ -48,6 +56,12 @@ describe Irwi::Extensions::Controllers::WikiPages do
48
56
  it { @obj.should respond_to :history }
49
57
  it { @obj.should respond_to :compare }
50
58
  it { @obj.should respond_to :destroy }
59
+
60
+ specify "should correctly handle current_user" do
61
+ @obj.send(:setup_current_user)
62
+ @obj.send(:current_user).should == 'Some user'
63
+ @obj.instance_variable_get(:@current_user).should == 'Some user'
64
+ end
51
65
 
52
66
  end
53
67
 
@@ -36,9 +36,10 @@ describe Irwi::Helpers::WikiPagesHelper do
36
36
  Irwi.config.formatter = mock 'Formatter'
37
37
  Irwi.config.formatter.should_receive(:format).with('Page content').and_return('Formatted content')
38
38
 
39
- @m.should_receive(:sanitize).with('Formatted content').and_return('Formatted and sanitized content')
39
+ @m.should_receive(:auto_link).with('Formatted content').and_return('Formatted content with links')
40
+ @m.should_receive(:sanitize).with('Formatted content with links').and_return('Formatted and sanitized content with links')
40
41
 
41
- @m.wiki_content( 'Page content' ).should == 'Formatted and sanitized content'
42
+ @m.wiki_content( 'Page content' ).should == 'Formatted and sanitized content with links'
42
43
  end
43
44
 
44
45
  specify "should render wiki_page_info partial" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: irwi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexey Noskov
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-10-26 00:00:00 +03:00
12
+ date: 2009-10-27 00:00:00 +03:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency