We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7d707aa commit 3b87cb3Copy full SHA for 3b87cb3
Gemfile
@@ -21,8 +21,6 @@ if version == 'master'
21
# Rails 5
22
gem 'actionview'
23
end
24
- # Rails 5
25
- gem 'rails-controller-testing', github: 'rails/rails-controller-testing'
26
else
27
gem_version = "~> #{version}.0"
28
gem 'railties', gem_version
test/support/test_case.rb
@@ -2,4 +2,12 @@
2
def setup
3
@routes = TestHelper::Routes
4
5
+
6
+ # For Rails5
7
+ # https://github.com/rails/rails/commit/ca83436d1b3b6cedd1eca2259f65661e69b01909#diff-b9bbf56e85d3fe1999f16317f2751e76L17
8
+ def assigns(key = nil)
9
+ assigns = {}.with_indifferent_access
10
+ @controller.view_assigns.each { |k, v| assigns.regular_writer(k, v) }
11
+ key.nil? ? assigns : assigns[key]
12
+ end
13
0 commit comments