Rubocop rules

This commit is contained in:
Nedim
2025-02-17 19:12:40 +01:00
parent ef01db0700
commit ee89170c32
42 changed files with 1043 additions and 267 deletions

View File

@@ -17,7 +17,19 @@ class CompaniesControllerTest < ActionDispatch::IntegrationTest
test "should create company" do
assert_difference("Company.count") do
post companies_url, params: { company: { address_line_one: @company.address_line_one, address_line_two: @company.address_line_two, city: @company.city, country: @company.country, entity: @company.entity, id_number: @company.id_number, name: @company.name, postal_code: @company.postal_code, vat_number: @company.vat_number } }
post companies_url, params: {
company: {
address_line_one: @company.address_line_one,
address_line_two: @company.address_line_two,
city: @company.city,
country: @company.country,
entity: @company.entity,
id_number: @company.id_number,
name: @company.name,
postal_code: @company.postal_code,
vat_number: @company.vat_number
}
}
end
assert_redirected_to company_url(Company.last)
@@ -34,7 +46,19 @@ class CompaniesControllerTest < ActionDispatch::IntegrationTest
end
test "should update company" do
patch company_url(@company), params: { company: { address_line_one: @company.address_line_one, address_line_two: @company.address_line_two, city: @company.city, country: @company.country, entity: @company.entity, id_number: @company.id_number, name: @company.name, postal_code: @company.postal_code, vat_number: @company.vat_number } }
patch company_url(@company), params: {
company: {
address_line_one: @company.address_line_one,
address_line_two: @company.address_line_two,
city: @company.city,
country: @company.country,
entity: @company.entity,
id_number: @company.id_number,
name: @company.name,
postal_code: @company.postal_code,
vat_number: @company.vat_number
}
}
assert_redirected_to company_url(@company)
end

View File

@@ -17,7 +17,15 @@ class CustomersControllerTest < ActionDispatch::IntegrationTest
test "should create customer" do
assert_difference("Customer.count") do
post customers_url, params: { customer: { birthyear: @customer.birthyear, email: @customer.email, name: @customer.name, notes: @customer.notes, phone: @customer.phone } }
post customers_url, params: {
customer: {
birthyear: @customer.birthyear,
email: @customer.email,
name: @customer.name,
notes: @customer.notes,
phone: @customer.phone
}
}
end
assert_redirected_to customer_url(Customer.last)
@@ -34,7 +42,15 @@ class CustomersControllerTest < ActionDispatch::IntegrationTest
end
test "should update customer" do
patch customer_url(@customer), params: { customer: { birthyear: @customer.birthyear, email: @customer.email, name: @customer.name, notes: @customer.notes, phone: @customer.phone } }
patch customer_url(@customer), params: {
customer: {
birthyear: @customer.birthyear,
email: @customer.email,
name: @customer.name,
notes: @customer.notes,
phone: @customer.phone
}
}
assert_redirected_to customer_url(@customer)
end

View File

@@ -17,7 +17,17 @@ class ReservationsControllerTest < ActionDispatch::IntegrationTest
test "should create reservation" do
assert_difference("Reservation.count") do
post reservations_url, params: { reservation: { company_id: @reservation.company_id, customer_id: @reservation.customer_id, description: @reservation.description, end_time: @reservation.end_time, place_id: @reservation.place_id, start_time: @reservation.start_time, title: @reservation.title } }
post reservations_url, params: {
reservation: {
company_id: @reservation.company_id,
customer_id: @reservation.customer_id,
description: @reservation.description,
end_time: @reservation.end_time,
place_id: @reservation.place_id,
start_time: @reservation.start_time,
title: @reservation.title
}
}
end
assert_redirected_to reservation_url(Reservation.last)
@@ -34,7 +44,17 @@ class ReservationsControllerTest < ActionDispatch::IntegrationTest
end
test "should update reservation" do
patch reservation_url(@reservation), params: { reservation: { company_id: @reservation.company_id, customer_id: @reservation.customer_id, description: @reservation.description, end_time: @reservation.end_time, place_id: @reservation.place_id, start_time: @reservation.start_time, title: @reservation.title } }
patch reservation_url(@reservation), params: {
reservation: {
company_id: @reservation.company_id,
customer_id: @reservation.customer_id,
description: @reservation.description,
end_time: @reservation.end_time,
place_id: @reservation.place_id,
start_time: @reservation.start_time,
title: @reservation.title
}
}
assert_redirected_to reservation_url(@reservation)
end

View File

@@ -17,7 +17,7 @@ class TeamsControllerTest < ActionDispatch::IntegrationTest
test "should create team" do
assert_difference("Team.count") do
post teams_url, params: { team: { } }
post teams_url, params: { team: {} }
end
assert_redirected_to team_url(Team.last)
@@ -34,7 +34,7 @@ class TeamsControllerTest < ActionDispatch::IntegrationTest
end
test "should update team" do
patch team_url(@team), params: { team: { } }
patch team_url(@team), params: { team: {} }
assert_redirected_to team_url(@team)
end