on-test-spec 0.2.5 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION.yml +3 -3
- data/lib/test/spec/rails/expectations.rb +5 -4
- metadata +19 -8
- data/.gitignore +0 -1
data/VERSION.yml
CHANGED
@@ -16,10 +16,11 @@ module Test
|
|
16
16
|
# or:
|
17
17
|
# should.redirect_to :controller => 'foo', :action => 'bar', :secure => true
|
18
18
|
def redirect(*args)
|
19
|
+
redirect_url = @object.response.respond_to?(:redirect_url) ? @object.response.redirect_url : @object.response.redirected_to
|
19
20
|
if args.empty?
|
20
|
-
test_case.assert_response
|
21
|
+
test_case.assert_response redirect_url, :redirect
|
21
22
|
elsif args.length == 1 and args.first.is_a?(String)
|
22
|
-
test_case.assert_equal args.first,
|
23
|
+
test_case.assert_equal args.first, redirect_url
|
23
24
|
else
|
24
25
|
options = args.extract_options!
|
25
26
|
if secure = options.delete(:secure)
|
@@ -30,9 +31,9 @@ module Test
|
|
30
31
|
|
31
32
|
@object.instance_eval { test_case.assert_redirected_to *args }
|
32
33
|
if secure == true
|
33
|
-
test_case.assert
|
34
|
+
test_case.assert redirect_url.starts_with?('https:')
|
34
35
|
elsif secure == false
|
35
|
-
test_case.assert
|
36
|
+
test_case.assert redirect_url.starts_with?('http:')
|
36
37
|
end
|
37
38
|
end
|
38
39
|
end
|
metadata
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: on-test-spec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 27
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 2
|
9
|
+
- 6
|
10
|
+
version: 0.2.6
|
5
11
|
platform: ruby
|
6
12
|
authors:
|
7
13
|
- Manfred Stienstra
|
@@ -11,7 +17,7 @@ autorequire:
|
|
11
17
|
bindir: bin
|
12
18
|
cert_chain: []
|
13
19
|
|
14
|
-
date:
|
20
|
+
date: 2011-02-23 00:00:00 +01:00
|
15
21
|
default_executable:
|
16
22
|
dependencies: []
|
17
23
|
|
@@ -25,7 +31,6 @@ extra_rdoc_files:
|
|
25
31
|
- LICENSE
|
26
32
|
- README
|
27
33
|
files:
|
28
|
-
- .gitignore
|
29
34
|
- LICENSE
|
30
35
|
- README
|
31
36
|
- Rakefile
|
@@ -59,26 +64,32 @@ homepage: http://github.com/Fingertips/on-test-spec
|
|
59
64
|
licenses: []
|
60
65
|
|
61
66
|
post_install_message:
|
62
|
-
rdoc_options:
|
63
|
-
|
67
|
+
rdoc_options: []
|
68
|
+
|
64
69
|
require_paths:
|
65
70
|
- lib
|
66
71
|
required_ruby_version: !ruby/object:Gem::Requirement
|
72
|
+
none: false
|
67
73
|
requirements:
|
68
74
|
- - ">="
|
69
75
|
- !ruby/object:Gem::Version
|
76
|
+
hash: 3
|
77
|
+
segments:
|
78
|
+
- 0
|
70
79
|
version: "0"
|
71
|
-
version:
|
72
80
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
73
82
|
requirements:
|
74
83
|
- - ">="
|
75
84
|
- !ruby/object:Gem::Version
|
85
|
+
hash: 3
|
86
|
+
segments:
|
87
|
+
- 0
|
76
88
|
version: "0"
|
77
|
-
version:
|
78
89
|
requirements: []
|
79
90
|
|
80
91
|
rubyforge_project:
|
81
|
-
rubygems_version: 1.
|
92
|
+
rubygems_version: 1.5.2
|
82
93
|
signing_key:
|
83
94
|
specification_version: 3
|
84
95
|
summary: Rails plugin to make testing Rails on test/spec easier.
|
data/.gitignore
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
pkg/
|