Skip to content

Commit

Permalink
specs
Browse files Browse the repository at this point in the history
  • Loading branch information
michelson committed Feb 25, 2024
1 parent f935025 commit 3203653
Show file tree
Hide file tree
Showing 23 changed files with 2,517 additions and 9 deletions.
11 changes: 4 additions & 7 deletions .rubocop.yml
Expand Up @@ -9,13 +9,12 @@ Style/StringLiterals:
Enabled: true
EnforcedStyle: double_quotes
SupportedStyles:
- single_quotes
- double_quotes
- single_quotes
- double_quotes

Style/HashSyntax:
EnforcedShorthandSyntax: never


Rails/EnvironmentVariableAccess:
AllowReads: true

Expand All @@ -24,7 +23,7 @@ Lint/EmptyBlock:
- 'spec/**/*'
Metrics/BlockLength:
Exclude:
- 'spec/**/*'
- 'spec/**/*'

Style/OpenStructUse:
Enabled: false
Expand All @@ -41,6 +40,7 @@ Metrics/ModuleLength:
Exclude:
- app/helpers/application_helper.rb
- app/services/message_apis/helpers.rb
- spec/**/*
Rails/InverseOf:
Enabled: false

Expand All @@ -59,6 +59,3 @@ AllCops:
- 'tmp/**/*'
- 'spec/e2e/**/*'
- public/assets/**/*



2 changes: 2 additions & 0 deletions app/controllers/messenger/auth_controller.rb
Expand Up @@ -37,6 +37,8 @@ def create
inbound_settings: @app.inbound_settings,
inline_conversations: ActiveModel::Type::Boolean.new.cast(@app.inline_new_conversations)
}
rescue OriginValidator::NonAcceptedOrigin => e
render json: { error: e.message }, status: :unauthorized
end

private
Expand Down
1 change: 1 addition & 0 deletions app/frontend/components/list_renderer/component.html.erb
Expand Up @@ -2,6 +2,7 @@
<% @field.each do |item| %>
<div class="list-item cursor-pointer"
<% if item["action"] %>
data-cy="action-<%= item["id"] %>"
data-action="<%= action_method(item["action"]) %>"
data-field-json="<%= item.to_json %>"
<% end %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/devise/sessions/new.html.erb
Expand Up @@ -46,7 +46,7 @@
<%= form_for(resource,
as: resource_name,
url: session_path(resource_name),
class: "mt-8 space-y-6", data: {'turbo-frame': '_top' } ) do |f| %>
class: "mt-8 space-y-6", data: {'turbo': false } ) do |f| %>

<div class="rounded-md shadow-sm -space-y-px">

Expand Down
22 changes: 21 additions & 1 deletion spec/rails_helper.rb
Expand Up @@ -54,6 +54,26 @@
metadata[:type] = :view_component
end

require "falcon/capybara"

Capybara.configure do |config| # rubocop:disable Lint/ShadowingOuterLocalVariable
# This forces capybara to create a new server instance for each session/spec:
config.reuse_server = false

# config.server_port = 5002
# config.server_host = "localhost"
config.default_max_wait_time = 10
config.raise_server_errors == false

config.server = :falcon
config.javascript_driver = :selenium_chrome_headless

app, = Rack::Builder.parse_file(Rails.root.join("config.ru").to_s)
config.app = app
end

config.include FeatureHelpers, type: :system

# https://github.com/rspec/rspec-rails/issues/2410
config.include ActiveSupport::Testing::Assertions
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
Expand Down Expand Up @@ -101,7 +121,7 @@
metadata[:browser] = true
end

config.filter_run_excluding browser: true
# config.filter_run_excluding browser: true

config.include Devise::Test::ControllerHelpers, type: :controller
# RSpec Rails can automatically mix in different behaviours to your tests
Expand Down

0 comments on commit 3203653

Please sign in to comment.