{"record":{"id":"315d96a96c061893","repo":"thoughtbot/shoulda-matchers","slug":"using-set-flash-with-the-now-qualifier-and-spe","errorCode":null,"errorMessage":"Using `set_flash` with the `now` qualifier and specifying `now` after other\nqualifiers is no longer allowed.\n\nYou'll want to use `now` immediately after `set_flash`. For instance:\n\n    # Valid\n    should set_flash.now[:foo]\n    should set_flash.now[:foo].to('bar')\n\n    # Invalid\n    should set_flash[:foo].now\n    should set_flash[:foo].to('bar').now","messagePattern":"Using `set_flash` with the `now` qualifier and specifying `now` after other\nqualifiers is no longer allowed\\.\n\nYou'll want to use `now` immediately after `set_flash`\\. For instance:\n\n    # Valid\n    should set_flash\\.now\\[:foo\\]\n    should set_flash\\.now\\[:foo\\]\\.to\\('bar'\\)\n\n    # Invalid\n    should set_flash\\[:foo\\]\\.now\n    should set_flash\\[:foo\\]\\.to\\('bar'\\)\\.now","errorType":"exception","errorClass":"QualifierOrderError","httpStatus":null,"severity":"error","filePath":"lib/shoulda/matchers/action_controller/set_flash_matcher.rb","lineNumber":177,"sourceCode":"          :description,\n          :matches?,\n          :failure_message,\n          :failure_message_when_negated\n        alias_method \\\n          :failure_message_for_should,\n          :failure_message\n        alias_method \\\n          :failure_message_for_should_not,\n          :failure_message_when_negated\n\n        def initialize\n          store = FlashStore.future\n          @underlying_matcher = SetSessionOrFlashMatcher.new(store)\n        end\n\n        def now\n          if key || expected_value\n            raise QualifierOrderError\n          end\n\n          store = FlashStore.now\n          @underlying_matcher = SetSessionOrFlashMatcher.new(store)\n          self\n        end\n\n        def in_context(context)\n          underlying_matcher.in_context(context)\n          self\n        end\n\n        def [](key)\n          @key = key\n          underlying_matcher[key]\n          self\n        end\n","sourceCodeStart":159,"sourceCodeEnd":195,"githubUrl":"https://github.com/thoughtbot/shoulda-matchers/blob/79cdfbc326e97c9b43991b644434ca53c1f62c4c/lib/shoulda/matchers/action_controller/set_flash_matcher.rb#L159-L195","documentation":"Error \"Using `set_flash` with the `now` qualifier and specifying `now` after other\nqualifiers is no longer allowed.\n\nYou'll want to use `now` immediately after `set_flash`. For instance:\n\n    # Valid\n    should set_flash.now[:foo]\n    should set_flash.now[:foo].to('bar')\n\n    # Invalid\n    should set_flash[:foo].now\n    should set_flash[:foo].to('bar').now\" thrown in thoughtbot/shoulda-matchers.","triggerScenarios":"Thrown at lib/shoulda/matchers/action_controller/set_flash_matcher.rb:177 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"79cdfbc326e97c9b43991b644434ca53c1f62c4c","analyzedAt":"2026-08-23T09:43:24.200Z","schemaVersion":2},"datasetVersion":"2026-08-23T13:39:53.451Z"}