simple_workflow 0.3.5 → 0.3.6
Sign up to get free protection for your applications and to get access to all the features.
- data/History.rdoc +7 -1
- data/lib/simple_workflow/helper.rb +3 -3
- data/lib/simple_workflow/version.rb +1 -1
- data/lib/simple_workflow.rb +1 -1
- data/test/simple_workflow_test.rb +24 -0
- data/test/test_helper.rb +2 -0
- metadata +5 -5
- data/test/test_simple_workflow.rb +0 -11
data/History.rdoc
CHANGED
@@ -10,9 +10,9 @@ module SimpleWorkflow::Helper
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def with_detour(options, back_options = {})
|
13
|
-
|
14
|
-
url = url_for(options)
|
15
|
-
return url + (url =~ /\?/ ? '&' : '?') +
|
13
|
+
detour = params.merge(back_options).reject { |k, v| [:detour, :return_from_detour].include? k.to_sym }
|
14
|
+
url = url_for(options)
|
15
|
+
return url + (url =~ /\?/ ? '&' : '?') + detour.to_param('detour')
|
16
16
|
end
|
17
17
|
|
18
18
|
def image_detour_to(image_source, title, url_options, image_options = nil, link_options = nil)
|
data/lib/simple_workflow.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
$:.unshift(File.dirname(__FILE__)) unless
|
2
2
|
$:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
|
3
3
|
|
4
|
-
require 'action_controller
|
4
|
+
require 'action_controller'
|
5
5
|
|
6
6
|
require 'simple_workflow/version'
|
7
7
|
require 'simple_workflow/helper'
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/test_helper.rb'
|
2
|
+
|
3
|
+
class SimpleWorkflowTest < Test::Unit::TestCase
|
4
|
+
include SimpleWorkflow::Helper
|
5
|
+
|
6
|
+
def setup
|
7
|
+
end
|
8
|
+
|
9
|
+
def test_with_detour
|
10
|
+
assert_equal '?detour%5Baction%5D=myaction&detour%5Bcontroller%5D=mycontroller&detour%5Bid%5D=42&detour%5Bquery%5D%5Bnested%5D=criterium',
|
11
|
+
with_detour('')
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def params
|
17
|
+
{:controller => 'mycontroller', :action => 'myaction', :id => 42, :query => {:nested => 'criterium'}}
|
18
|
+
end
|
19
|
+
|
20
|
+
# FIXME(donv): This should not be faked.
|
21
|
+
def url_for(options)
|
22
|
+
options.to_s
|
23
|
+
end
|
24
|
+
end
|
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_workflow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 0.3.
|
9
|
+
- 6
|
10
|
+
version: 0.3.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Uwe Kubosch
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-
|
18
|
+
date: 2012-12-18 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: rails
|
@@ -50,8 +50,8 @@ files:
|
|
50
50
|
- lib/simple_workflow/test_helper.rb
|
51
51
|
- lib/simple_workflow/version.rb
|
52
52
|
- lib/simple_workflow.rb
|
53
|
+
- test/simple_workflow_test.rb
|
53
54
|
- test/test_helper.rb
|
54
|
-
- test/test_simple_workflow.rb
|
55
55
|
homepage: https://github.com/donv/simple_workflow
|
56
56
|
licenses: []
|
57
57
|
|