paginate_alphabetically 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -11,6 +11,7 @@ begin
11
11
  gem.homepage = "http://github.com/edendevelopment/paginate_alphabetically"
12
12
  gem.authors = ["Eden Development"]
13
13
  gem.add_development_dependency "activerecord", ">= 2.3.5"
14
+ gem.add_development_dependency "mocha"
14
15
  gem.add_development_dependency "sqlite3-ruby", "1.2.5"
15
16
  # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
16
17
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.2.1
data/lib/view_helpers.rb CHANGED
@@ -15,7 +15,7 @@ module PaginateAlphabetically
15
15
 
16
16
  def paginated_letter(available_letters, letter)
17
17
  if available_letters.include?(letter)
18
- link_to(letter, "?letter=#{letter}")
18
+ link_to(letter, "#{request.path}?letter=#{letter}")
19
19
  else
20
20
  letter
21
21
  end
data/test/helper.rb CHANGED
@@ -5,6 +5,7 @@ require 'test/unit'
5
5
  require 'sqlite3'
6
6
  require 'active_record'
7
7
  require 'action_view'
8
+ require 'mocha'
8
9
  include ActionView::Helpers
9
10
  require File.expand_path(File.join(File.dirname(__FILE__), '../init.rb'))
10
11
 
@@ -1,6 +1,15 @@
1
1
  require File.expand_path(File.join(File.dirname(__FILE__), 'helper'))
2
2
  include PaginateAlphabetically::ViewHelpers
3
3
 
4
+
5
+ module PaginateAlphabetically
6
+ module ViewHelpers
7
+ def request
8
+ stub(:path => '')
9
+ end
10
+ end
11
+ end
12
+
4
13
  class ViewHelperTest < ActiveSupport::TestCase
5
14
  def setup
6
15
  @result = alphabetically_paginate([Thing.create!(:name => 'a')])
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paginate_alphabetically
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 0
10
- version: 0.2.0
9
+ - 1
10
+ version: 0.2.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Eden Development
@@ -35,9 +35,23 @@ dependencies:
35
35
  type: :development
36
36
  version_requirements: *id001
37
37
  - !ruby/object:Gem::Dependency
38
- name: sqlite3-ruby
38
+ name: mocha
39
39
  prerelease: false
40
40
  requirement: &id002 !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ hash: 3
46
+ segments:
47
+ - 0
48
+ version: "0"
49
+ type: :development
50
+ version_requirements: *id002
51
+ - !ruby/object:Gem::Dependency
52
+ name: sqlite3-ruby
53
+ prerelease: false
54
+ requirement: &id003 !ruby/object:Gem::Requirement
41
55
  none: false
42
56
  requirements:
43
57
  - - "="
@@ -49,7 +63,7 @@ dependencies:
49
63
  - 5
50
64
  version: 1.2.5
51
65
  type: :development
52
- version_requirements: *id002
66
+ version_requirements: *id003
53
67
  description: Provides a list of available letters, and a way of fetching the records for each letter.
54
68
  email: dev+gems@edendevelopment.co.uk
55
69
  executables: []