Skip to content

Commit

Permalink
Fix lint nits
Browse files Browse the repository at this point in the history
  • Loading branch information
pixeldesu committed Oct 26, 2023
1 parent ad434ae commit 78f3daa
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions app/controllers/relationships_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def create
UseCase::Relationship::Create.call(
source_user: current_user,
target_user: ::User.find_by!(screen_name: params[:screen_name]),
type: params[:type]
type: params[:type],
)

respond_to do |format|
Expand All @@ -30,7 +30,7 @@ def destroy
UseCase::Relationship::Destroy.call(
source_user: current_user,
target_user: ::User.find_by!(screen_name: params[:screen_name]),
type: params[:type]
type: params[:type],
)

respond_to do |format|
Expand Down
3 changes: 2 additions & 1 deletion app/views/relationships/_destroy.html.haml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
- if type == "follow"
= button_to relationships_path(screen_name:, type:), method: :delete, form: { id: "#{type}-#{screen_name}" }, class: "btn btn-primary", form_class: "d-grid" do
= button_to relationships_path(screen_name:, type:), method: :delete, form: { id: "#{type}-#{screen_name}" }, class: "btn btn-primary",
form_class: "d-grid" do
= t("voc.unfollow")

- if type == "block"
Expand Down
8 changes: 4 additions & 4 deletions spec/controllers/relationships_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@

let(:type) { "Sauerkraut" }
let(:screen_name) { user2.screen_name }
let(:params) { { type: type, screen_name: screen_name } }
let(:params) { { type:, screen_name: } }

subject { post(:create, params: params, format: :turbo_stream) }
subject { post(:create, params:, format: :turbo_stream) }

it_behaves_like "requires login"

Expand Down Expand Up @@ -116,9 +116,9 @@

let(:type) { "Sauerkraut" }
let(:screen_name) { user2.screen_name }
let(:params) { { type: type, screen_name: screen_name } }
let(:params) { { type:, screen_name: } }

subject { delete(:destroy, params: params, format: :turbo_stream) }
subject { delete(:destroy, params:, format: :turbo_stream) }

it_behaves_like "requires login"

Expand Down
2 changes: 1 addition & 1 deletion spec/shared_examples/error_raising.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
end
end

RSpec.shared_examples_for "turbo does not succeed" do |part_of_error_message|
RSpec.shared_examples_for "turbo does not succeed" do
it "turbo does not succeed" do
subject
# FIXME: for some reason, partials are not rendered, making the actual error message not accessible
Expand Down

0 comments on commit 78f3daa

Please sign in to comment.