Make `turbo does not succeed` example for in `RelationshipsController`
This commit is contained in:
parent
54fb4d09fd
commit
e802e0197d
|
@ -8,6 +8,8 @@ class RelationshipsController < ApplicationController
|
|||
turbo_stream_actions :create, :destroy
|
||||
|
||||
def create
|
||||
params.require :screen_name
|
||||
|
||||
UseCase::Relationship::Create.call(
|
||||
source_user: current_user,
|
||||
target_user: ::User.find_by!(screen_name: params[:screen_name]),
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
require "rails_helper"
|
||||
|
||||
describe RelationshipsController, type: :controller do
|
||||
render_views
|
||||
|
||||
shared_examples_for "params is empty" do
|
||||
let(:params) { {} }
|
||||
|
||||
|
|
|
@ -14,10 +14,9 @@ RSpec.shared_examples_for "ajax does not succeed" do |part_of_error_message|
|
|||
end
|
||||
end
|
||||
|
||||
RSpec.shared_examples_for "turbo does not succeed" do
|
||||
RSpec.shared_examples_for "turbo does not succeed" do |part_of_error_message|
|
||||
it "turbo does not succeed" do
|
||||
subject
|
||||
# FIXME: for some reason, partials are not rendered, making the actual error message not accessible
|
||||
expect(response.body).to include "turbo-stream action=\"append\" target=\"toasts\""
|
||||
expect(response.body).to include(part_of_error_message)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue