Skip to content

Commit

Permalink
Add support for Rails 7.1 and Ruby 3.3 and 3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
UweKubosch committed Jun 9, 2024
1 parent 22e9b24 commit bef716c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ require 'rubocop/rake_task'
RuboCop::RakeTask.new

namespace :test do
task full: ['rubocop:auto_correct', :test]
task full: ['rubocop:autocorrect_all', :test]
end
2 changes: 1 addition & 1 deletion lib/simple_workflow/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def with_detour(options, origin = origin_options)
end
origin.update(origin_options) if origin.keys == [:anchor]
url = url_for(options)
url + (/\?/.match?(url) ? '&' : '?') + origin.to_h.to_param('detour')
url + (url.include?('?') ? '&' : '?') + origin.to_h.to_param('detour')
end

def origin_options
Expand Down
8 changes: 4 additions & 4 deletions test/middleware_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def test_get_without_detour
status, headers, response = @stack.call env

assert_equal 200, status
assert_equal ['app response'], response
assert_equal ['app response'], [*response]
assert_equal [], headers['rack.session'].to_hash.keys
assert_nil headers['rack.session'].to_hash['detours']
end
Expand Down Expand Up @@ -53,7 +53,7 @@ def test_detour_cleanup
status, env, response = @stack.call last_env

assert_equal 200, status
assert_equal ['app response'], response
assert_equal ['app response'], [*response]
assert_equal(%w[session_id detours], env['rack.session'].to_hash.keys)

assert_equal(((57..99).to_a + [:last]).map { |i| { 'controller' => "test_#{i}" } },
Expand All @@ -69,7 +69,7 @@ def test_huge_detour_over_4k
status, headers, response = @stack.call env

assert_equal 200, status
assert_equal ['app response'], response
assert_equal ['app response'], [*response]
assert_equal(%w[session_id], headers['rack.session'].to_hash.keys)
end

Expand All @@ -82,7 +82,7 @@ def test_return_from_detour

assert_equal 200, status
assert_match(%r{_session_id=\w+--\w+; path=/; httponly}, headers['set-cookie'])
assert_equal ['app response'], response
assert_equal ['app response'], [*response]
assert_equal ['session_id'], headers['rack.session'].to_hash.keys
assert_nil headers['rack.session'].to_hash['detours']
end
Expand Down

0 comments on commit bef716c

Please sign in to comment.