Empact-authlogic_rpx 1.1.6 → 1.1.7
Sign up to get free protection for your applications and to get access to all the features.
- data/Empact-authlogic_rpx.gemspec +3 -1
- data/VERSION +1 -1
- data/lib/authlogic_rpx/helper.rb +2 -1
- data/test/unit/helpers_test.rb +23 -0
- metadata +4 -2
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{Empact-authlogic_rpx}
|
8
|
-
s.version = "1.1.
|
8
|
+
s.version = "1.1.7"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Paul Gallagher / tardate"]
|
@@ -52,6 +52,7 @@ Gem::Specification.new do |s|
|
|
52
52
|
"test/test_helper.rb",
|
53
53
|
"test/test_internal_mapping_helper.rb",
|
54
54
|
"test/unit/acts_as_authentic_settings_test.rb",
|
55
|
+
"test/unit/helpers_test.rb",
|
55
56
|
"test/unit/session_settings_test.rb",
|
56
57
|
"test/unit/session_validation_test.rb",
|
57
58
|
"test/unit/verify_rpx_mock_test.rb"
|
@@ -76,6 +77,7 @@ Gem::Specification.new do |s|
|
|
76
77
|
"test/test_helper.rb",
|
77
78
|
"test/test_internal_mapping_helper.rb",
|
78
79
|
"test/unit/acts_as_authentic_settings_test.rb",
|
80
|
+
"test/unit/helpers_test.rb",
|
79
81
|
"test/unit/session_settings_test.rb",
|
80
82
|
"test/unit/session_validation_test.rb",
|
81
83
|
"test/unit/verify_rpx_mock_test.rb"
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.7
|
data/lib/authlogic_rpx/helper.rb
CHANGED
@@ -36,7 +36,8 @@ module AuthlogicRpx
|
|
36
36
|
private
|
37
37
|
|
38
38
|
def build_token_url!( options )
|
39
|
-
options.delete( :return_url )
|
39
|
+
url = options.delete( :return_url )
|
40
|
+
url + (url.include?('?') ? '&' : '?') + (
|
40
41
|
{ :authenticity_token => form_authenticity_token, :add_rpx => options.delete( :add_rpx ) }.collect { |n| "#{n[0]}=#{ u(n[1]) }" if n[1] }
|
41
42
|
).compact.join('&')
|
42
43
|
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../test_helper.rb'
|
2
|
+
|
3
|
+
class HelpersTest < ActiveSupport::TestCase
|
4
|
+
class HelpersContext
|
5
|
+
def form_authenticity_token
|
6
|
+
'foo'
|
7
|
+
end
|
8
|
+
|
9
|
+
def u(something)
|
10
|
+
something
|
11
|
+
end
|
12
|
+
|
13
|
+
include AuthlogicRpx::Helper
|
14
|
+
end
|
15
|
+
|
16
|
+
must "generate a return url with an authenticity token" do
|
17
|
+
assert_true HelpersContext.new.send(:build_token_url!, :return_url => '/').include?('/?authenticity_token=')
|
18
|
+
end
|
19
|
+
|
20
|
+
must "not repeat ? when params exist" do
|
21
|
+
assert_equal 1, HelpersContext.new.send(:build_token_url!, :return_url => '/?myparam=bar').count('?')
|
22
|
+
end
|
23
|
+
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 1.1.
|
8
|
+
- 7
|
9
|
+
version: 1.1.7
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Paul Gallagher / tardate
|
@@ -90,6 +90,7 @@ files:
|
|
90
90
|
- test/test_helper.rb
|
91
91
|
- test/test_internal_mapping_helper.rb
|
92
92
|
- test/unit/acts_as_authentic_settings_test.rb
|
93
|
+
- test/unit/helpers_test.rb
|
93
94
|
- test/unit/session_settings_test.rb
|
94
95
|
- test/unit/session_validation_test.rb
|
95
96
|
- test/unit/verify_rpx_mock_test.rb
|
@@ -138,6 +139,7 @@ test_files:
|
|
138
139
|
- test/test_helper.rb
|
139
140
|
- test/test_internal_mapping_helper.rb
|
140
141
|
- test/unit/acts_as_authentic_settings_test.rb
|
142
|
+
- test/unit/helpers_test.rb
|
141
143
|
- test/unit/session_settings_test.rb
|
142
144
|
- test/unit/session_validation_test.rb
|
143
145
|
- test/unit/verify_rpx_mock_test.rb
|