- with_message_limit(0) do
- post :new,
- :params => { :display_name => recipient_user.display_name,
- :message => { :title => "Test Message", :body => "Test message body" } }
- assert_response :success
- assert_template "new"
- assert_select ".error", /wait a while/
+ with_settings(:max_messages_per_hour => 0) do
+ perform_enqueued_jobs do
+ post messages_path(:display_name => recipient_user.display_name,
+ :message => { :title => "Test Message", :body => "Test message body" })
+ assert_response :success
+ assert_template "new"
+ assert_select ".alert.alert-danger", /wait a while/
+ end