{"action":"closed","issue":{"url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/issues/636","labels_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/issues/636/labels{/name}","comments_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/issues/636/comments","events_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/issues/636/events","html_url":"https://github.com/thoughtbot/shoulda-matchers/issues/636","id":53303917,"number":636,"title":"NoMethodError: undefined method `flash'","user":{"login":"osiro","id":97817,"avatar_url":"https://avatars.githubusercontent.com/u/97817?v=3","gravatar_id":"","url":"https://api.github.com/users/osiro","html_url":"https://github.com/osiro","followers_url":"https://api.github.com/users/osiro/followers","following_url":"https://api.github.com/users/osiro/following{/other_user}","gists_url":"https://api.github.com/users/osiro/gists{/gist_id}","starred_url":"https://api.github.com/users/osiro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/osiro/subscriptions","organizations_url":"https://api.github.com/users/osiro/orgs","repos_url":"https://api.github.com/users/osiro/repos","events_url":"https://api.github.com/users/osiro/events{/privacy}","received_events_url":"https://api.github.com/users/osiro/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/labels/Need%20to%20Investigate","name":"Need to Investigate","color":"f7c6c7"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/milestones/8","labels_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/milestones/8/labels","id":928932,"number":8,"title":"2.8.0","description":"","creator":{"login":"mcmire","id":7371,"avatar_url":"https://avatars.githubusercontent.com/u/7371?v=3","gravatar_id":"","url":"https://api.github.com/users/mcmire","html_url":"https://github.com/mcmire","followers_url":"https://api.github.com/users/mcmire/followers","following_url":"https://api.github.com/users/mcmire/following{/other_user}","gists_url":"https://api.github.com/users/mcmire/gists{/gist_id}","starred_url":"https://api.github.com/users/mcmire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcmire/subscriptions","organizations_url":"https://api.github.com/users/mcmire/orgs","repos_url":"https://api.github.com/users/mcmire/repos","events_url":"https://api.github.com/users/mcmire/events{/privacy}","received_events_url":"https://api.github.com/users/mcmire/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":5,"state":"open","created_at":"2015-01-09T17:10:40Z","updated_at":"2015-02-12T23:30:22Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2015-01-03T13:18:15Z","updated_at":"2015-02-12T23:30:22Z","closed_at":"2015-02-12T23:30:22Z","body":"Hey guys,\r\n\r\nNot sure if it's only me, but I'm getting the following error with the matcher `set_flash`.\r\n\r\n```bash\r\nNoMethodError:\r\n  undefined method `flash' for #<ActionController::TestResponse>\r\n.../shoulda-matchers-2.8.0.rc1/lib/shoulda/matchers/action_controller/set_flash_matcher.rb:242:in `copy_of_flash_from_controller'\r\n.../shoulda-matchers-2.8.0.rc1/lib/shoulda/matchers/action_controller/set_flash_matcher.rb:238:in `flash'\r\n.../shoulda-matchers-2.8.0.rc1/lib/shoulda/matchers/action_controller/set_flash_matcher.rb:230:in `flash_values'\r\n.../shoulda-matchers-2.8.0.rc1/lib/shoulda/matchers/action_controller/set_flash_matcher.rb:209:in `sets_the_flash?'\r\n.../shoulda-matchers-2.8.0.rc1/lib/shoulda/matchers/action_controller/set_flash_matcher.rb:187:in `matches?'\r\n```\r\n\r\nUsing:\r\n\r\n* Rails 4.2.0\r\n* rspec-rails 3.1.0\r\n* Ruby 2.2.0\r\n* shoulda-matchers-2.8.0.rc1\r\n\r\nIt works fine when replacing the following piece of code: https://github.com/thoughtbot/shoulda-matchers/blob/master/lib/shoulda/matchers/action_controller/set_flash_matcher.rb#L243 with:\r\n\r\n```ruby\r\ndef copy_of_flash_from_controller\r\n  @controller.request.flash.dup.tap do |flash|\r\n    copy_flashes(@controller.request.flash, flash)\r\n    copy_discard_if_necessary(@controller.request.flash, flash)\r\n    sweep_flash_if_necessary(flash)\r\n  end\r\nend\r\n```\r\n\r\nI was about to Pull Request the changes but l've got a bunch of failing specs when testing against Ruby 2.2.0 (as per https://github.com/thoughtbot/shoulda-matchers/pull/632).\r\n\r\nHappy 2015! :tada: :tada: :tada: "}}