Skip to content

Some tests fail if run locally #10381

@Alex808r

Description

@Alex808r

Describe the bug

Case 1

If you set any locale in the default configuration file except :en, then some tests fail.

This is because error messages in these tests are waiting for messages in the en locale.
To solve this situation, specify
config.i18n.default_locale = :en for config/environments/test.rb

Case 2

Error example
response was a 500 because an UnsafeRedirectError exception

1) Session GET /auth/sign_in redirects to the frontend login page with error
      Failure/Error: expect(response).to redirect_to(%r{/app/login\?error=access-denied$})
        Expected response to be a <3XX: redirect>, but was a <500: Internal Server Error>
        ActionController::Redirecting::UnsafeRedirectError:
       Unsafe redirect to "http://0.0.0.0:3000....

To solve this error need add
config.action_controller.raise_on_open_redirects = false to config/environments/test.rb

To Reproduce

  1. set any default locale except :en
  2. run command bundle exec rspec spec

Expected behavior

No response

Environment

app.chatwoot.com

Cloud Provider

None

Platform

None

Operating system

Mac os Sonoma

Browser and version

No response

Docker (if applicable)

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething is not working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions