redirector 0.1.5 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe 'Redirector middleware' do
3
+ describe 'Redirector middleware', :type => :feature do
4
4
  before do
5
5
  FactoryGirl.create(:redirect_rule, :destination => '/news/5', :source => '/my_custom_url')
6
6
  FactoryGirl.create(:redirect_rule_regex, :destination => '/news/$1', :source => '/my_custom_url/([A-Za-z0-9_]+)')
@@ -30,6 +30,24 @@ describe 'Redirector middleware' do
30
30
  Redirector.include_query_in_source = original_option
31
31
  end
32
32
 
33
+ it 'should preserve the query string if the Redirector.preserve_query is true' do
34
+ original_option = Redirector.preserve_query
35
+ Redirector.preserve_query = true
36
+ visit '/my_custom_url/20?categoryID=12345'
37
+ uri = URI.parse(current_url)
38
+ uri.query.should == 'categoryID=12345'
39
+ current_path.should == '/news/20'
40
+ Redirector.preserve_query = original_option
41
+ end
42
+
43
+ it 'should stil work with silenced ActiveRecord logs' do
44
+ original_option = Redirector.silence_sql_logs
45
+ Redirector.silence_sql_logs = true
46
+ visit '/my_custom_url/20'
47
+ current_path.should == '/news/20'
48
+ Redirector.preserve_query = original_option
49
+ end
50
+
33
51
  it 'handles requests with or without a port specified' do
34
52
  Capybara.app_host = 'http://example.com'
35
53
 
@@ -1,5 +1,8 @@
1
1
  $LOAD_PATH.unshift(File.dirname(__FILE__))
2
2
  ENV['RAILS_ENV'] ||= 'test'
3
+ require 'simplecov'
4
+ require 'coveralls'
5
+ Coveralls.wear! 'rails'
3
6
 
4
7
  require File.expand_path("../dummy/config/environment.rb", __FILE__)
5
8
  require 'rspec/rails'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redirector
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Landau
@@ -29,7 +29,7 @@ cert_chain:
29
29
  QHjym4e4y/FmXBJjpO/TtRoYd8a5YTCaOsML7M/nb/XrArvE3l5JaNEXkhH/nGs7
30
30
  wR9huisTMlESX3ReGKU=
31
31
  -----END CERTIFICATE-----
32
- date: 2014-01-17 00:00:00.000000000 Z
32
+ date: 2014-03-08 00:00:00.000000000 Z
33
33
  dependencies:
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: rails
@@ -59,6 +59,20 @@ dependencies:
59
59
  - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
+ - !ruby/object:Gem::Dependency
63
+ name: pg
64
+ requirement: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ type: :development
70
+ prerelease: false
71
+ version_requirements: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
62
76
  - !ruby/object:Gem::Dependency
63
77
  name: rspec-rails
64
78
  requirement: !ruby/object:Gem::Requirement
@@ -143,6 +157,34 @@ dependencies:
143
157
  - - ">="
144
158
  - !ruby/object:Gem::Version
145
159
  version: '0'
160
+ - !ruby/object:Gem::Dependency
161
+ name: rake
162
+ requirement: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
167
+ type: :development
168
+ prerelease: false
169
+ version_requirements: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ - !ruby/object:Gem::Dependency
175
+ name: coveralls
176
+ requirement: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
181
+ type: :development
182
+ prerelease: false
183
+ version_requirements: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - ">="
186
+ - !ruby/object:Gem::Version
187
+ version: '0'
146
188
  description: A Rails engine that adds a piece of middleware to the top of your middleware
147
189
  stack that looks for redirect rules stored in your database and redirects you accordingly.
148
190
  email:
@@ -176,6 +218,7 @@ files:
176
218
  - spec/dummy/config.ru
177
219
  - spec/dummy/config/application.rb
178
220
  - spec/dummy/config/boot.rb
221
+ - spec/dummy/config/database.travis.yml
179
222
  - spec/dummy/config/database.yml
180
223
  - spec/dummy/config/database.yml.example
181
224
  - spec/dummy/config/environment.rb
@@ -237,6 +280,7 @@ test_files:
237
280
  - spec/dummy/app/views/layouts/application.html.erb
238
281
  - spec/dummy/config/application.rb
239
282
  - spec/dummy/config/boot.rb
283
+ - spec/dummy/config/database.travis.yml
240
284
  - spec/dummy/config/database.yml
241
285
  - spec/dummy/config/database.yml.example
242
286
  - spec/dummy/config/environment.rb