Module: ResponseIntegrationHelper

Included in:
LesliTesting::IntegrationTester
Defined in:
lib/lesli_testing/helpers/response_integration_helper.rb

Overview

Lesli

Copyright © 2025, Lesli Technologies, S. A.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see www.gnu.org/licenses/.

Lesli · Ruby on Rails SaaS Development Framework.

Made with ♥ by LesliTech Building a better future, one line of code at a time.

// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ // ·

Instance Method Summary collapse

Instance Method Details

#expect_response_with_successfulObject

test a standard successful response for lesli 3



42
43
44
45
# File 'lib/lesli_testing/helpers/response_integration_helper.rb', line 42

def expect_response_with_successful 
    assert_response(:success)
    assert_equal("application/json; charset=utf-8", @response.content_type)
end

#response_jsonObject

return the body of a request response parsed as JSON



36
37
38
# File 'lib/lesli_testing/helpers/response_integration_helper.rb', line 36

def response_json
    JSON.parse(@response.body.blank? ? "{}" : @response.body) 
end